Chapter 4 Diversity analysis

load("data/data.Rdata")

4.1 Alpha diversity

# Calculate Hill numbers
richness <- genome_counts_filt %>%
  column_to_rownames(var = "genome") %>%
  dplyr::select(where(~ !all(. == 0))) %>%
  hilldiv(., q = 0) %>%
  t() %>%
  as.data.frame() %>%
  dplyr::rename(richness = 1) %>%
  rownames_to_column(var = "sample")

neutral <- genome_counts_filt %>%
  column_to_rownames(var = "genome") %>%
  dplyr::select(where(~ !all(. == 0))) %>%
  hilldiv(., q = 1) %>%
  t() %>%
  as.data.frame() %>%
  dplyr::rename(neutral = 1) %>%
  rownames_to_column(var = "sample")

phylogenetic <- genome_counts_filt %>%
  column_to_rownames(var = "genome") %>%
  dplyr::select(where(~ !all(. == 0))) %>%
  hilldiv(., q = 1, tree = genome_tree) %>%
  t() %>%
  as.data.frame() %>%
  dplyr::rename(phylogenetic = 1) %>%
  rownames_to_column(var = "sample")

# Merge all metrics
alpha_div <- richness %>%
  full_join(neutral, by = join_by(sample == sample)) %>%
  full_join(phylogenetic, by = join_by(sample == sample))

4.1.1 Acclimation samples

alpha_div %>%
  pivot_longer(-sample, names_to = "metric", values_to = "value") %>%
  left_join(., sample_metadata, by = join_by(sample == Tube_code)) %>%
  filter(time_point=="1_Acclimation") %>%
  mutate(metric=factor(metric,levels=c("richness","neutral","phylogenetic"))) %>%
      ggplot(aes(y = value, x = Population, group=Population, color=Population, fill=Population)) +
      geom_boxplot(outlier.shape = NA) +
      geom_jitter(alpha=0.5) +
      scale_color_manual(name="Population",
          breaks=c("Cold_wet","Hot_dry"),
          labels=c("Cold","Hot"),
          values=c('#008080', "#d57d2c")) +
      scale_fill_manual(name="Population",
          breaks=c("Cold_wet","Hot_dry"),
          labels=c("Cold","Hot"),
          values=c('#00808050', "#d57d2c50")) +
      facet_wrap(. ~ metric,scales = "free") +
      coord_cartesian(xlim = c(1, NA)) +
      stat_compare_means(size=3, label.x=.58) +
      theme_classic() +
        theme(
    strip.background = element_blank(),
    panel.grid.minor.x = element_line(size = .1, color = "grey"),
    axis.title.x = element_blank(),
    axis.title.y = element_text(size=10),
    axis.text.x = element_text(angle = 45, hjust = 1),
    # Increase plot size
    plot.title = element_text(size = 10),
    axis.text = element_text(size = 8),
    axis.title = element_text(size = 8)
      ) +
  ylab("Alpha diversity")

4.1.2 Antibiotics samples

alpha_div %>%
  pivot_longer(-sample, names_to = "metric", values_to = "value") %>%
  left_join(., sample_metadata, by = join_by(sample == Tube_code)) %>%
  filter(time_point=="2_Antibiotics") %>%
  mutate(metric=factor(metric,levels=c("richness","neutral","phylogenetic"))) %>%
      ggplot(aes(y = value, x = Population, group=Population, color=Population, fill=Population)) +
      geom_boxplot(outlier.shape = NA) +
      geom_jitter(alpha=0.5) +
      scale_color_manual(name="Population",
          breaks=c("Cold_wet","Hot_dry"),
          labels=c("Cold","Hot"),
          values=c('#008080', "#d57d2c")) +
      scale_fill_manual(name="Population",
          breaks=c("Cold_wet","Hot_dry"),
          labels=c("Cold","Hot"),
          values=c('#00808050', "#d57d2c50")) +
      facet_wrap(. ~ metric,scales = "free") +
      coord_cartesian(xlim = c(1, NA)) +
      stat_compare_means(size=3, label.x=.58) +
      theme_classic() +
        theme(
    strip.background = element_blank(),
    panel.grid.minor.x = element_line(size = .1, color = "grey"),
    axis.title.x = element_blank(),
    axis.title.y = element_text(size=10),
    axis.text.x = element_text(angle = 45, hjust = 1),
    # Increase plot size
    plot.title = element_text(size = 10),
    axis.text = element_text(size = 8),
    axis.title = element_text(size = 8)
      ) +
  ylab("Alpha diversity")

4.1.3 Transplant_1 samples

alpha_div %>%
  pivot_longer(-sample, names_to = "metric", values_to = "value") %>%
  left_join(., sample_metadata, by = join_by(sample == Tube_code)) %>%
  filter(time_point=="3_Transplant1") %>%
  mutate(metric=factor(metric,levels=c("richness","neutral","phylogenetic"))) %>%
      ggplot(aes(y = value, x = type, group=type, color=type, fill=type)) +
      geom_boxplot(outlier.shape = NA) +
      geom_jitter(alpha=0.5) +
      scale_color_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-Cold","Hot-Hot", "Cold-Hot"),
          values=c("#4477AA","#d57d2c", "#76b183")) +
      scale_fill_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-Cold","Hot-Hot", "Cold-Hot"),
          values=c("#4477AA50","#d57d2c50","#76b18350")) +
      facet_wrap(. ~ metric,scales = "free") +
      coord_cartesian(xlim = c(1, NA)) +
      stat_compare_means(size=3, label.x=.7) +
      theme_classic() +
        theme(
    strip.background = element_blank(),
    panel.grid.minor.x = element_line(size = .1, color = "grey"),
    axis.title.x = element_blank(),
    axis.title.y = element_text(size=10),
    axis.text.x = element_text(angle = 45, hjust = 1),
    # Increase plot size
    plot.title = element_text(size = 10),
    axis.text = element_text(size = 8),
    axis.title = element_text(size = 8)
      ) +
  ylab("Alpha diversity")

4.1.4 Transplant_2 samples

alpha_div %>%
  pivot_longer(-sample, names_to = "metric", values_to = "value") %>%
  left_join(., sample_metadata, by = join_by(sample == Tube_code)) %>%
  filter(time_point=="4_Transplant2") %>%
  mutate(metric=factor(metric,levels=c("richness","neutral","phylogenetic"))) %>%
      ggplot(aes(y = value, x = type, group=type, color=type, fill=type)) +
      geom_boxplot(outlier.shape = NA) +
      geom_jitter(alpha=0.5) +
      scale_color_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-Cold","Hot-Hot", "Cold-Hot"),
          values=c("#4477AA","#d57d2c", "#76b183")) +
      scale_fill_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-Cold","Hot-Hot", "Cold-Hot"),
          values=c("#4477AA50","#d57d2c50","#76b18350")) +
      facet_wrap(. ~ metric,scales = "free") +
      coord_cartesian(xlim = c(1, NA)) +
      stat_compare_means(size=3, label.x=.7) +
      theme_classic() +
        theme(
    strip.background = element_blank(),
    panel.grid.minor.x = element_line(size = .1, color = "grey"),
    axis.title.x = element_blank(),
    axis.title.y = element_text(size=10),
    axis.text.x = element_text(angle = 45, hjust = 1),
    # Increase plot size
    plot.title = element_text(size = 10),
    axis.text = element_text(size = 8),
    axis.title = element_text(size = 8)
      ) +
  ylab("Alpha diversity")

4.1.5 Post-Transplant_1 samples

alpha_div %>%
  pivot_longer(-sample, names_to = "metric", values_to = "value") %>%
  left_join(., sample_metadata, by = join_by(sample == Tube_code)) %>%
  filter(time_point=="5_Post-FMT1") %>%
  mutate(metric=factor(metric,levels=c("richness","neutral","phylogenetic"))) %>%
      ggplot(aes(y = value, x = type, group=type, color=type, fill=type)) +
      geom_boxplot(outlier.shape = NA) +
      geom_jitter(alpha=0.5) +
      scale_color_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-Cold","Hot-Hot", "Cold-Hot"),
          values=c("#4477AA","#d57d2c", "#76b183")) +
      scale_fill_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-Cold","Hot-Hot", "Cold-Hot"),
          values=c("#4477AA50","#d57d2c50","#76b18350")) +
      facet_wrap(. ~ metric,scales = "free") +
      coord_cartesian(xlim = c(1, NA)) +
      stat_compare_means(size=3, label.x=.7) +
      theme_classic() +
        theme(
    strip.background = element_blank(),
    panel.grid.minor.x = element_line(size = .1, color = "grey"),
    axis.title.x = element_blank(),
    axis.title.y = element_text(size=10),
    axis.text.x = element_text(angle = 45, hjust = 1),
    # Increase plot size
    plot.title = element_text(size = 10),
    axis.text = element_text(size = 8),
    axis.title = element_text(size = 8)
      ) +
  ylab("Alpha diversity")

4.1.6 Post-Transplant_2 samples

alpha_div %>%
  pivot_longer(-sample, names_to = "metric", values_to = "value") %>%
  left_join(., sample_metadata, by = join_by(sample == Tube_code)) %>%
  filter(time_point=="6_Post-FMT2") %>%
  mutate(metric=factor(metric,levels=c("richness","neutral","phylogenetic"))) %>%
      ggplot(aes(y = value, x = type, group=type, color=type, fill=type)) +
      geom_boxplot(outlier.shape = NA) +
      geom_jitter(alpha=0.5) +
      scale_color_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-control","Warm-control", "Cold-intervention"),
          values=c("#4477AA","#d57d2c", "#76b183")) +
      scale_fill_manual(name="Type",
          breaks=c("Control","Hot_control", "Treatment"),
          labels=c("Cold-control","Warm-control", "Cold-intervention"),
          values=c("#4477AA50","#d57d2c50","#76b18350")) +
      facet_wrap(. ~ metric,scales = "free") +
      coord_cartesian(xlim = c(1, NA)) +
      stat_compare_means(size=3, label.x=.7) +
      theme_classic() +
        theme(
    strip.background = element_blank(),
    panel.grid.minor.x = element_line(size = .1, color = "grey"),
    axis.title.x = element_blank(),
    axis.title.y = element_text(size=10),
    axis.text.x = element_text(angle = 45, hjust = 1),
    # Increase plot size
    plot.title = element_text(size = 10),
    axis.text = element_text(size = 8),
    axis.title = element_text(size = 8)
      ) +
  ylab("Alpha diversity")

4.2 Beta diversity

beta_q0n <- genome_counts_filt %>%
  column_to_rownames(., "genome") %>%
  hillpair(., q = 0)

beta_q1n <- genome_counts_filt %>%
  column_to_rownames(., "genome") %>%
  hillpair(., q = 1)

beta_q1p <- genome_counts_filt %>%
  column_to_rownames(., "genome") %>%
  hillpair(., q = 1, tree = genome_tree)

4.3 Permanovas

4.3.0.1 Load required data

meta <- column_to_rownames(sample_metadata, "Tube_code")

4.3.1 1. Do the antibiotics work?

4.3.1.1 Antibiotics

treat1 <- meta  %>%
  filter(time_point == "2_Antibiotics")

temp_genome_counts <- transform(genome_counts_filt, row.names = genome_counts_filt$genome)
temp_genome_counts$genome <- NULL

treat1.counts <- temp_genome_counts[,which(colnames(temp_genome_counts) %in% rownames(treat1))]
identical(sort(colnames(treat1.counts)),sort(as.character(rownames(treat1))))

treat1_nmds <- sample_metadata %>%
  filter(time_point == "2_Antibiotics")
4.3.1.1.1 Number of samples used
[1] 23
beta_div_richness_treat1<-hillpair(data=treat1.counts, q=0)
beta_div_neutral_treat1<-hillpair(data=treat1.counts, q=1)
beta_div_phylo_treat1<-hillpair(data=treat1.counts, q=1, tree=genome_tree)
4.3.1.1.2 Richness
betadisper(beta_div_richness_treat1$S, treat1$Population) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df   Sum Sq   Mean Sq      F N.Perm Pr(>F)  
Groups     1 0.015319 0.0153186 6.8764    999  0.021 *
Residuals 21 0.046782 0.0022277                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
         Cold_wet Hot_dry
Cold_wet            0.017
Hot_dry  0.015919        
adonis2(formula=beta_div_richness_treat1$S ~ Population, data=treat1[labels(beta_div_neutral_treat1$S),], permutations=999) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 1 1.356644 0.1527052 3.784762 0.001
Residual 21 7.527429 0.8472948 NA NA
Total 22 8.884073 1.0000000 NA NA
4.3.1.1.3 Neutral
betadisper(beta_div_neutral_treat1$S, treat1$Population) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df   Sum Sq   Mean Sq      F N.Perm Pr(>F)  
Groups     1 0.030536 0.0305358 3.8593    999   0.06 .
Residuals 21 0.166158 0.0079123                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
         Cold_wet Hot_dry
Cold_wet            0.065
Hot_dry  0.062842        
adonis2(formula=beta_div_neutral_treat1$S ~ Population, data=treat1[labels(beta_div_neutral_treat1$S),], permutations=999) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 1 1.785669 0.2085055 5.532084 0.001
Residual 21 6.778468 0.7914945 NA NA
Total 22 8.564137 1.0000000 NA NA
4.3.1.1.4 Phylogenetic
betadisper(beta_div_phylo_treat1$S, treat1$Population) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df   Sum Sq  Mean Sq      F N.Perm Pr(>F)
Groups     1 0.012041 0.012041 0.9898    999  0.336
Residuals 21 0.255459 0.012165                     

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
         Cold_wet Hot_dry
Cold_wet            0.331
Hot_dry   0.33111        
adonis2(formula=beta_div_phylo_treat1$S ~ Population, data=treat1[labels(beta_div_phylo_treat1$S),], permutations=999) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 1 0.8963254 0.1888758 4.889993 0.001
Residual 21 3.8492558 0.8111242 NA NA
Total 22 4.7455811 1.0000000 NA NA
beta_richness_nmds_treat1 <- beta_div_richness_treat1$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(treat1_nmds, by = c("sample" = "Tube_code"))

beta_neutral_nmds_treat1 <- beta_div_neutral_treat1$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(treat1_nmds, by = c("sample" = "Tube_code"))

beta_phylo_nmds_treat1 <- beta_div_phylo_treat1$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(treat1_nmds, by = join_by(sample == Tube_code))

4.3.1.2 Acclimation vs antibiotics

treat <- meta  %>%
  filter(time_point == "1_Acclimation" | time_point == "2_Antibiotics")

temp_genome_counts <- transform(genome_counts_filt, row.names = genome_counts_filt$genome)
temp_genome_counts$genome <- NULL

treat.counts <- temp_genome_counts[,which(colnames(temp_genome_counts) %in% rownames(treat))]
identical(sort(colnames(treat.counts)),sort(as.character(rownames(treat))))

treat_nmds <- sample_metadata %>%
  filter(time_point == "1_Acclimation" | time_point == "2_Antibiotics")
4.3.1.2.1 Number of samples used
[1] 50
beta_div_richness_treat<-hillpair(data=treat.counts, q=0)
beta_div_neutral_treat<-hillpair(data=treat.counts, q=1)
beta_div_phylo_treat<-hillpair(data=treat.counts, q=1, tree=genome_tree)
#Arrange of metadata dataframe
treat_arrange<-treat[labels(beta_div_neutral_treat$S),]
treat_arrange$type_time <- interaction(treat_arrange$type, treat_arrange$time_point)
4.3.1.2.2 Richness
betadisper(beta_div_richness_treat$S, treat$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df   Sum Sq   Mean Sq     F N.Perm Pr(>F)  
Groups     1 0.025318 0.0253178 6.021    999  0.013 *
Residuals 48 0.201837 0.0042049                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 2_Antibiotics
1_Acclimation                       0.012
2_Antibiotics      0.017817              
adonis2(formula=beta_div_richness_treat$S ~ time_point*Population, data=treat[labels(beta_div_neutral_treat$S),], permutations=999,strata=treat$individual) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 4.885035 0.2455889 4.991572 0.001
Residual 46 15.006068 0.7544111 NA NA
Total 49 19.891103 1.0000000 NA NA
pairwise <- pairwise.adonis(beta_div_richness_treat$S, treat_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.3620815 1.0521088 0.06169963 0.350 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.2800877 4.6054436 0.22350616 0.001 0.015 .
Control.1_Acclimation vs Control.2_Antibiotics 1 1.0114074 2.8299035 0.15871670 0.001 0.015 .
Control.1_Acclimation vs Treatment.2_Antibiotics 1 0.9204347 2.4632144 0.14961929 0.002 0.030 .
Control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.3738469 4.0051127 0.21073870 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.3606630 5.0871520 0.24124415 0.001 0.015 .
Treatment.1_Acclimation vs Control.2_Antibiotics 1 0.9707039 2.8037141 0.15747917 0.001 0.015 .
Treatment.1_Acclimation vs Treatment.2_Antibiotics 1 0.8277738 2.2885999 0.14050317 0.002 0.030 .
Treatment.1_Acclimation vs Hot_control.2_Antibiotics 1 1.4551542 4.3850542 0.22620799 0.001 0.015 .
Hot_control.1_Acclimation vs Control.2_Antibiotics 1 1.7346072 6.2936958 0.29556615 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.2_Antibiotics 1 1.5634787 5.4659371 0.28079496 0.001 0.015 .
Hot_control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.2328439 4.7193158 0.23932452 0.001 0.015 .
Control.2_Antibiotics vs Treatment.2_Antibiotics 1 0.3007616 0.7949621 0.05762698 0.810 1.000
Control.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.0978513 3.1806716 0.18513081 0.001 0.015 .
Treatment.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.0695525 2.9566393 0.18529210 0.001 0.015 .
4.3.1.2.3 Neutral
betadisper(beta_div_neutral_treat$S, treat$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df   Sum Sq  Mean Sq      F N.Perm Pr(>F)  
Groups     1 0.039587 0.039587 6.8387    999  0.013 *
Residuals 48 0.277854 0.005789                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 2_Antibiotics
1_Acclimation                       0.017
2_Antibiotics      0.011886              
adonis2(formula=beta_div_neutral_treat$S ~ time_point*Population, data=treat[labels(beta_div_neutral_treat$S),], permutations=999,strata=treat$individual) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 5.756853 0.3024978 6.649871 0.001
Residual 46 13.274204 0.6975022 NA NA
Total 49 19.031057 1.0000000 NA NA
pairwise <- pairwise.adonis(beta_div_neutral_treat$S, treat_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.2316020 0.7712905 0.04598874 0.723 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.4015347 5.7562378 0.26457873 0.001 0.015 .
Control.1_Acclimation vs Control.2_Antibiotics 1 1.0524088 3.2499157 0.17807839 0.001 0.015 .
Control.1_Acclimation vs Treatment.2_Antibiotics 1 1.1115532 3.4118917 0.19595181 0.003 0.045 .
Control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.7659070 6.0767588 0.28831562 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.6347704 6.8326887 0.29925029 0.001 0.015 .
Treatment.1_Acclimation vs Control.2_Antibiotics 1 1.0258101 3.2124718 0.17638857 0.001 0.015 .
Treatment.1_Acclimation vs Treatment.2_Antibiotics 1 0.8812272 2.7455916 0.16395907 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.2_Antibiotics 1 1.8759542 6.5571073 0.30417380 0.001 0.015 .
Hot_control.1_Acclimation vs Control.2_Antibiotics 1 1.8018302 6.9639403 0.31706243 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.2_Antibiotics 1 1.7960588 7.0145016 0.33379338 0.001 0.015 .
Hot_control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.1400941 5.0556070 0.25207948 0.001 0.015 .
Control.2_Antibiotics vs Treatment.2_Antibiotics 1 0.3090918 0.8838203 0.06365829 0.595 1.000
Control.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.3183156 4.2483600 0.23280777 0.001 0.015 .
Treatment.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.4966720 4.8065093 0.26992990 0.001 0.015 .
4.3.1.2.4 Phylogenetic
betadisper(beta_div_phylo_treat$S, treat$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df  Sum Sq Mean Sq      F N.Perm Pr(>F)    
Groups     1 0.58372 0.58372 35.413    999  0.001 ***
Residuals 48 0.79119 0.01648                         
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 2_Antibiotics
1_Acclimation                       0.001
2_Antibiotics    2.9795e-07              
adonis2(formula=beta_div_phylo_treat$S ~ time_point*Population, data=treat[labels(beta_div_phylo_treat$S),], permutations=999,strata=treat$individual) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 2.947011 0.344846 8.070832 0.001
Residual 46 5.598866 0.655154 NA NA
Total 49 8.545877 1.000000 NA NA
pairwise <- pairwise.adonis(beta_div_phylo_treat$S, treat_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.04186923 0.4391642 0.02671451 0.750 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 0.15609416 2.5546889 0.13768428 0.037 0.555
Control.1_Acclimation vs Control.2_Antibiotics 1 0.86133708 5.6599878 0.27395891 0.001 0.015 .
Control.1_Acclimation vs Treatment.2_Antibiotics 1 0.91317327 6.5682162 0.31933815 0.003 0.045 .
Control.1_Acclimation vs Hot_control.2_Antibiotics 1 0.70006680 5.4923385 0.26801912 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 0.23108846 4.0521838 0.20208192 0.003 0.045 .
Treatment.1_Acclimation vs Control.2_Antibiotics 1 0.69687259 4.7138353 0.23911305 0.003 0.045 .
Treatment.1_Acclimation vs Treatment.2_Antibiotics 1 0.68913760 5.1284906 0.26810744 0.005 0.075
Treatment.1_Acclimation vs Hot_control.2_Antibiotics 1 0.59659295 4.8457011 0.24416880 0.001 0.015 .
Hot_control.1_Acclimation vs Control.2_Antibiotics 1 1.09724077 9.8570170 0.39654867 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.2_Antibiotics 1 1.22358928 12.8466332 0.47851934 0.001 0.015 .
Hot_control.1_Acclimation vs Hot_control.2_Antibiotics 1 0.66150542 7.6387977 0.33742064 0.001 0.015 .
Control.2_Antibiotics vs Treatment.2_Antibiotics 1 0.09408368 0.4635496 0.03442997 0.880 1.000
Control.2_Antibiotics vs Hot_control.2_Antibiotics 1 0.63116074 3.3932653 0.19509076 0.001 0.015 .
Treatment.2_Antibiotics vs Hot_control.2_Antibiotics 1 0.75130538 4.3068752 0.24885343 0.002 0.030 .
beta_richness_nmds_treat <- beta_div_richness_treat$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(treat_nmds, by = c("sample" = "Tube_code"))

beta_neutral_nmds_treat <- beta_div_neutral_treat$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(treat_nmds, by = c("sample" = "Tube_code"))

beta_phylo_nmds_treat <- beta_div_phylo_treat$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(treat_nmds, by = join_by(sample == Tube_code))

4.3.2 2. Does the FMT work?

4.3.2.1 Comparison between FMT1 and FMT2

#Create newID to identify duplicated samples
transplants_metadata<-sample_metadata%>%
  mutate(Tube_code=str_remove_all(Tube_code, "_a"))
transplants_metadata$newID <- paste(transplants_metadata$Tube_code, "_", transplants_metadata$individual)

transplant_all<-transplants_metadata%>%
  filter(time_point == "3_Transplant1" | time_point == "4_Transplant2")%>%
  filter(Tube_code != "AD45"| Tube_code != "AD48") %>%
  column_to_rownames("newID")

transplant_all_nmds <- transplants_metadata %>%
  filter(time_point == "3_Transplant1" | time_point == "4_Transplant2")%>%
  filter(Tube_code != "AD45"| Tube_code != "AD48")

full_counts<-temp_genome_counts %>%
    t()%>%
    as.data.frame()%>%
    rownames_to_column("Tube_code")%>%
    full_join(transplants_metadata,by = join_by(Tube_code == Tube_code))

transplant_all_counts<-full_counts %>%
  filter(time_point == "3_Transplant1" | time_point == "4_Transplant2") %>%
  subset(select=-c(315:324)) %>%
  column_to_rownames("newID")%>%
  subset(select=-c(1))%>%
  t() %>%
  as.data.frame() %>%
  mutate_if(is.character, as.numeric) %>%
  subset(select=-c(47:48))

identical(sort(colnames(transplant_all_counts)),sort(as.character(rownames(transplant_all))))

4.3.2.2 Number of samples used

[1] 48
beta_div_richness_transplant_all<-hillpair(data=transplant_all_counts, q=0)
beta_div_neutral_transplant_all<-hillpair(data=transplant_all_counts, q=1)
beta_div_phylo_transplant_all<-hillpair(data=transplant_all_counts, q=1, tree=genome_tree)
#Arrange of metadata dataframe
transplant_all_arrange<-transplant_all[labels(beta_div_neutral_transplant_all$S),]
transplant_all_arrange$type_time <- interaction(transplant_all_arrange$type, transplant_all_arrange$time_point)
4.3.2.2.1 Richness
adonis2(formula=beta_div_richness_transplant_all$S ~ time_point*type, data=transplant_all[labels(beta_div_richness_transplant_all$S),], permutations=999) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 5 3.636954 0.3294321 3.930187 0.001
Residual 40 7.403117 0.6705679 NA NA
Total 45 11.040070 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_richness_transplant_all$S,transplant_all_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.3_Transplant1 vs Treatment.3_Transplant1 1 1.129362662 5.79950801 0.292911723 0.001 0.015 .
Control.3_Transplant1 vs Hot_control.3_Transplant1 1 1.208865861 6.33395382 0.296895450 0.001 0.015 .
Control.3_Transplant1 vs Control.4_Transplant2 1 0.131647583 0.64704882 0.038868680 0.876 1.000
Control.3_Transplant1 vs Treatment.4_Transplant2 1 1.120646022 5.84730567 0.310246237 0.001 0.015 .
Control.3_Transplant1 vs Hot_control.4_Transplant2 1 1.223919777 6.45841493 0.315685010 0.001 0.015 .
Treatment.3_Transplant1 vs Hot_control.3_Transplant1 1 0.009102921 0.05153754 0.003948772 1.000 1.000
Treatment.3_Transplant1 vs Control.4_Transplant2 1 1.314300451 6.84362433 0.328331782 0.001 0.015 .
Treatment.3_Transplant1 vs Treatment.4_Transplant2 1 0.074927876 0.42820379 0.037469037 0.975 1.000
Treatment.3_Transplant1 vs Hot_control.4_Transplant2 1 0.077903563 0.44805710 0.035994139 0.956 1.000
Hot_control.3_Transplant1 vs Control.4_Transplant2 1 1.410186386 7.48716456 0.332952807 0.001 0.015 .
Hot_control.3_Transplant1 vs Treatment.4_Transplant2 1 0.077823551 0.45304555 0.036380301 0.967 1.000
Hot_control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.067817527 0.39659721 0.029604324 0.983 1.000
Control.4_Transplant2 vs Treatment.4_Transplant2 1 1.248404869 6.61377735 0.337200593 0.001 0.015 .
Control.4_Transplant2 vs Hot_control.4_Transplant2 1 1.357472348 7.26616675 0.341677315 0.001 0.015 .
Treatment.4_Transplant2 vs Hot_control.4_Transplant2 1 0.012433593 0.07386441 0.006670157 1.000 1.000
4.3.2.2.2 Neutral
adonis2(formula=beta_div_neutral_transplant_all$S ~ time_point*type, data=transplant_all[labels(beta_div_neutral_transplant_all$S),], permutations=999) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 5 3.888690 0.3472704 4.256223 0.001
Residual 40 7.309185 0.6527296 NA NA
Total 45 11.197875 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_neutral_transplant_all$S,transplant_all_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.3_Transplant1 vs Treatment.3_Transplant1 1 1.210492327 6.33244693 0.311445393 0.001 0.015 .
Control.3_Transplant1 vs Hot_control.3_Transplant1 1 1.329816668 7.07170798 0.320396953 0.001 0.015 .
Control.3_Transplant1 vs Control.4_Transplant2 1 0.095527891 0.51782131 0.031349250 0.912 1.000
Control.3_Transplant1 vs Treatment.4_Transplant2 1 1.202957055 6.54398303 0.334833643 0.001 0.015 .
Control.3_Transplant1 vs Hot_control.4_Transplant2 1 1.336430279 7.33775774 0.343886074 0.001 0.015 .
Treatment.3_Transplant1 vs Hot_control.3_Transplant1 1 0.009634139 0.05096559 0.003905121 1.000 1.000
Treatment.3_Transplant1 vs Control.4_Transplant2 1 1.400930696 7.57729789 0.351169916 0.001 0.015 .
Treatment.3_Transplant1 vs Treatment.4_Transplant2 1 0.070676505 0.38364693 0.033701584 0.929 1.000
Treatment.3_Transplant1 vs Hot_control.4_Transplant2 1 0.078300724 0.42972488 0.034572356 0.884 1.000
Hot_control.3_Transplant1 vs Control.4_Transplant2 1 1.529217161 8.39335845 0.358792367 0.001 0.015 .
Hot_control.3_Transplant1 vs Treatment.4_Transplant2 1 0.067325622 0.37214249 0.030079066 0.920 1.000
Hot_control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.060700684 0.33852115 0.025379211 0.942 1.000
Control.4_Transplant2 vs Treatment.4_Transplant2 1 1.318966989 7.44875581 0.364264500 0.001 0.015 .
Control.4_Transplant2 vs Hot_control.4_Transplant2 1 1.461842335 8.31259383 0.372551658 0.001 0.015 .
Treatment.4_Transplant2 vs Hot_control.4_Transplant2 1 0.012314222 0.07128989 0.006439167 1.000 1.000
4.3.2.2.3 Phylogenetic
adonis2(formula=beta_div_phylo_transplant_all$S ~ time_point*type, data=transplant_all[labels(beta_div_phylo_transplant_all$S),], permutations=999) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 5 0.3748882 0.2242933 2.313177 0.007
Residual 40 1.2965312 0.7757067 NA NA
Total 45 1.6714194 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_phylo_transplant_all$S,transplant_all_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.3_Transplant1 vs Treatment.3_Transplant1 1 0.098602035 2.40012240 0.146347835 0.074 1.000
Control.3_Transplant1 vs Hot_control.3_Transplant1 1 0.111980145 2.78142890 0.156423250 0.012 0.180
Control.3_Transplant1 vs Control.4_Transplant2 1 0.007928377 0.35768341 0.021866385 0.935 1.000
Control.3_Transplant1 vs Treatment.4_Transplant2 1 0.107460204 3.49439587 0.211853523 0.009 0.135
Control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.123295950 4.08042827 0.225682058 0.002 0.030 .
Treatment.3_Transplant1 vs Hot_control.3_Transplant1 1 0.001916654 0.03838869 0.002944282 0.978 1.000
Treatment.3_Transplant1 vs Control.4_Transplant2 1 0.138394849 4.84607372 0.257139699 0.001 0.015 .
Treatment.3_Transplant1 vs Treatment.4_Transplant2 1 0.022693131 0.56103262 0.048527899 0.644 1.000
Treatment.3_Transplant1 vs Hot_control.4_Transplant2 1 0.016177953 0.41465150 0.033400172 0.775 1.000
Hot_control.3_Transplant1 vs Control.4_Transplant2 1 0.151529980 5.30364409 0.261216364 0.001 0.015 .
Hot_control.3_Transplant1 vs Treatment.4_Transplant2 1 0.018543667 0.46976985 0.037672696 0.694 1.000
Hot_control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.011324236 0.29624361 0.022280248 0.814 1.000
Control.4_Transplant2 vs Treatment.4_Transplant2 1 0.123072115 7.12848761 0.354149191 0.002 0.030 .
Control.4_Transplant2 vs Hot_control.4_Transplant2 1 0.149801593 8.46696532 0.376862883 0.001 0.015 .
Treatment.4_Transplant2 vs Hot_control.4_Transplant2 1 0.001788609 0.06719083 0.006071173 0.978 1.000
beta_richness_nmds_transplant_all <- beta_div_richness_transplant_all$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(transplant_all_nmds, by = join_by(sample == newID))

beta_neutral_nmds_transplant_all <- beta_div_neutral_transplant_all$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(transplant_all_nmds, by = join_by(sample == newID))

beta_phylo_nmds_transplant_all <- beta_div_phylo_transplant_all$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(transplant_all_nmds, by = join_by(sample == newID))
p0<-beta_richness_nmds_transplant_all %>%
            group_by(type) %>%
            mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
            mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
            ungroup() %>%
            ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
        scale_color_manual(name="Type",
                       breaks=c("Control", "Hot_control", "Treatment"),
                       labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                       values=c("#4477AA","#d57d2c","#76b183")) +
                geom_point(size=2) +
                geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
        labs(y = "NMDS2", x="NMDS1 \n Richness beta diversity") +
                theme_classic() +
                theme(legend.position="none")

p1<-beta_neutral_nmds_transplant_all %>%
            group_by(type) %>%
            mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
            mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
            ungroup() %>%
            ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
        scale_color_manual(name="Type",
                       breaks=c("Control", "Hot_control", "Treatment"),
                       labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                       values=c("#4477AA","#d57d2c","#76b183")) +
                geom_point(size=2) +
                geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
        labs(y = "NMDS2", x="NMDS1 \n Neutral beta diversity") +
                theme_classic() +
                theme(legend.position="none")
  
p2<-beta_phylo_nmds_transplant_all %>%
            group_by(type) %>%
            mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
            mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
            ungroup() %>%
            ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
                scale_color_manual(name="Type",
                       breaks=c("Control", "Hot_control", "Treatment"),
                       labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                       values=c("#4477AA","#d57d2c","#76b183")) +
                geom_point(size=2) +
                geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
        labs(y= element_blank (), x="NMDS1 \n Phylogenetic beta diversity") +
                theme_classic() +
                theme(legend.position="none")

4.3.2.3 Comparison between FMT2 vs Post-FMT2

#Create newID to identify duplicated samples
transplants_metadata<-sample_metadata%>%
  mutate(Tube_code=str_remove_all(Tube_code, "_a"))
transplants_metadata$newID <- paste(transplants_metadata$Tube_code, "_", transplants_metadata$individual)

transplant3<-transplants_metadata%>%
  filter(time_point == "4_Transplant2" | time_point == "6_Post-FMT2")%>%
  column_to_rownames("newID")

transplant3_nmds <- transplants_metadata %>%
  filter(time_point == "4_Transplant2" | time_point == "6_Post-FMT2")

full_counts<-temp_genome_counts %>%
    t()%>%
    as.data.frame()%>%
    rownames_to_column("Tube_code")%>%
    full_join(transplants_metadata,by = join_by(Tube_code == Tube_code))

transplant3_counts<-full_counts %>%
  filter(time_point == "4_Transplant2" | time_point == "6_Post-FMT2") %>%
  subset(select=-c(315:324)) %>%
  column_to_rownames("newID")%>%
  subset(select=-c(1))%>%
  t() %>%
  as.data.frame() %>%
  mutate_if(is.character, as.numeric)

identical(sort(colnames(transplant3_counts)),sort(as.character(rownames(transplant3))))

4.3.2.4 Number of samples used

[1] 49
beta_div_richness_transplant3<-hillpair(data=transplant3_counts, q=0)
beta_div_neutral_transplant3<-hillpair(data=transplant3_counts, q=1)
beta_div_phylo_transplant3<-hillpair(data=transplant3_counts, q=1, tree=genome_tree)
#Arrange of metadata dataframe
transplant3_arrange<-transplant3[labels(beta_div_neutral_transplant3$S),]
4.3.2.4.1 Richness
adonis2(formula=beta_div_richness_transplant3$S ~ Population+time_point+type, data=transplant3[labels(beta_div_richness_transplant3$S),], permutations=999, strata=transplant3$individual) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 3.500812 0.2535872 5.096117 0.001
Residual 45 10.304350 0.7464128 NA NA
Total 48 13.805162 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_richness_transplant3$S,transplant3_arrange$type, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control vs Treatment 1 1.4169018 5.739828 0.15622903 0.001 0.003 *
Control vs Hot_control 1 2.0940966 8.509112 0.21005427 0.001 0.003 *
Treatment vs Hot_control 1 0.3004618 1.265034 0.04179854 0.155 0.465
4.3.2.4.2 Neutral
adonis2(formula=beta_div_neutral_transplant3$S ~ Population+time_point+type, data=transplant3[labels(beta_div_neutral_transplant3$S),], permutations=999, strata=transplant3$individual) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 4.128749 0.3031142 6.524331 0.001
Residual 45 9.492350 0.6968858 NA NA
Total 48 13.621099 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_neutral_transplant3$S,transplant3_arrange$type, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control vs Treatment 1 1.8758788 8.282671 0.21084796 0.001 0.003 *
Control vs Hot_control 1 2.4396317 10.635546 0.24945256 0.001 0.003 *
Treatment vs Hot_control 1 0.3158428 1.394345 0.04587515 0.128 0.384
4.3.2.4.3 Phylogenetic
adonis2(formula=beta_div_phylo_transplant3$S ~ Population+time_point+type, data=transplant3[labels(beta_div_phylo_transplant3$S),], permutations=999, strata=transplant3$individual) %>%
        as.matrix() %>%
        kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 0.3971179 0.2701357 5.551766 0.001
Residual 45 1.0729504 0.7298643 NA NA
Total 48 1.4700683 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_phylo_transplant3$S,transplant3_arrange$type, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control vs Treatment 1 0.14387705 5.735321 0.15612552 0.001 0.003 *
Control vs Hot_control 1 0.22715701 9.044894 0.22036587 0.001 0.003 *
Treatment vs Hot_control 1 0.04648319 1.704277 0.05550617 0.123 0.369
beta_richness_nmds_transplant3 <- beta_div_richness_transplant3$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(transplant3_nmds, by = join_by(sample == newID))

beta_neutral_nmds_transplant3 <- beta_div_neutral_transplant3$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(transplant3_nmds, by = join_by(sample == newID))

beta_phylo_nmds_transplant3 <- beta_div_phylo_transplant3$S %>%
                metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
                scores() %>%
                as_tibble(., rownames = "sample") %>%
                left_join(transplant3_nmds, by = join_by(sample == newID))
p0<-beta_richness_nmds_transplant3 %>%
            group_by(individual) %>%
            mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
            mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
            ungroup() %>%
            ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
        scale_color_manual(name="Type",
                       breaks=c("Control", "Hot_control", "Treatment"),
                       labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                       values=c("#4477AA","#d57d2c","#76b183")) +
                geom_point(size=2) +
                geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
        labs(y = "NMDS2", x="NMDS1 \n Richness beta diversity") +
                theme_classic() +
                theme(legend.position="none")

p1<-beta_neutral_nmds_transplant3 %>%
            group_by(individual) %>%
            mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
            mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
            ungroup() %>%
            ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
        scale_color_manual(name="Type",
                       breaks=c("Control", "Hot_control", "Treatment"),
                       labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                       values=c("#4477AA","#d57d2c","#76b183")) +
                geom_point(size=2) +
                geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
        labs(y = "NMDS2", x="NMDS1 \n Neutral beta diversity") +
                theme_classic() +
                theme(legend.position="none")
  
p2<-beta_phylo_nmds_transplant3 %>%
            group_by(individual) %>%
            mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
            mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
            ungroup() %>%
            ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
                scale_color_manual(name="Type",
                       breaks=c("Control", "Hot_control", "Treatment"),
                       labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                       values=c("#4477AA","#d57d2c","#76b183")) +
                geom_point(size=2) +
                geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
        labs(y = "NMDS2", x="NMDS1 \n Phylogenetic beta diversity") +
                theme_classic() +
                theme(legend.position="none")

4.3.2.5 Comparison between the different experimental time points (Acclimation vs Transplant samples)

The estimated time for calculating the 5151 pairwise combinations is 21 seconds.
ggarrange( p1, p2, p3, ncol=3, nrow=1, common.legend = TRUE, legend="right")

4.3.2.6 Comparison of acclimation samples to transplant samples

transplant7<-transplants_metadata%>%
  filter(time_point == "4_Transplant2" | time_point == "1_Acclimation"| time_point == "3_Transplant1")%>%
  column_to_rownames("newID")

transplant7_nmds <- transplants_metadata %>%
  filter(time_point == "4_Transplant2" | time_point == "1_Acclimation"| time_point == "3_Transplant1")

transplant7_counts<-full_counts %>%
  filter(time_point == "4_Transplant2" | time_point == "1_Acclimation"| time_point == "3_Transplant1") %>%
  subset(select=-c(315:324)) %>%
  column_to_rownames("newID")%>%
  subset(select=-c(1))%>%
  t() %>%
  as.data.frame() %>%
  mutate_if(is.character, as.numeric)

transplant7_counts <- transplant7_counts[, !names(transplant7_counts) %in% c("AD45 _ LI1_2nd_2", "AD48 _ LI1_2nd_6")]

identical(sort(colnames(transplant7_counts)),sort(as.character(rownames(transplant7))))
[1] TRUE

4.3.2.7 Number of samples used

[1] 73
beta_div_richness_transplant7<-hillpair(data=transplant7_counts, q=0)
beta_div_neutral_transplant7<-hillpair(data=transplant7_counts, q=1)
beta_div_phylo_transplant7<-hillpair(data=transplant7_counts, q=1, tree=genome_tree)
#Arrange of metadata dataframe
transplant7_arrange<-transplant7[labels(beta_div_neutral_transplant7$S),]
transplant7_arrange <- transplant7_arrange %>%
  mutate(time_point = recode(time_point,
                             "3_Transplant1" = "Transplant",
                             "4_Transplant2" = "Transplant"))

transplant7_arrange$type_time <- interaction(transplant7_arrange$type, transplant7_arrange$time_point)
4.3.2.7.1 Richness
adonis2(formula=beta_div_richness_transplant7$S ~ Population*time_point+type, data=transplant7[labels(beta_div_richness_transplant7$S),], permutations=999, strata=transplant7$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 6 5.309519 0.2518733 3.703392 0.001
Residual 66 15.770599 0.7481267 NA NA
Total 72 21.080119 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_richness_transplant7$S,transplant7_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.36208146 1.0521088 0.06169963 0.326 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.28008774 4.6054436 0.22350616 0.002 0.030 .
Control.1_Acclimation vs Control.Transplant 1 0.55038651 2.2107376 0.08124505 0.002 0.030 .
Control.1_Acclimation vs Treatment.Transplant 1 1.62289430 6.7106689 0.25123553 0.001 0.015 .
Control.1_Acclimation vs Hot_control.Transplant 1 1.73215888 7.4315069 0.25250175 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.36066298 5.0871520 0.24124415 0.001 0.015 .
Treatment.1_Acclimation vs Control.Transplant 1 0.52860586 2.1820402 0.08027507 0.001 0.015 .
Treatment.1_Acclimation vs Treatment.Transplant 1 1.76810026 7.5736721 0.27467042 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.Transplant 1 1.87790626 8.3291875 0.27462613 0.001 0.015 .
Hot_control.1_Acclimation vs Control.Transplant 1 1.75314247 8.7706781 0.25971282 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.Transplant 1 0.27700454 1.5346880 0.07126586 0.084 1.000
Hot_control.1_Acclimation vs Hot_control.Transplant 1 0.26448976 1.4916174 0.06349573 0.094 1.000
Control.Transplant vs Treatment.Transplant 1 2.30884687 12.4299510 0.30002331 0.001 0.015 .
Control.Transplant vs Hot_control.Transplant 1 2.50396161 13.6713271 0.30604256 0.001 0.015 .
Treatment.Transplant vs Hot_control.Transplant 1 0.01688622 0.1023282 0.00392027 0.999 1.000
4.3.2.7.2 Neutral
adonis2(formula=beta_div_neutral_transplant7$S ~ Population+time_point*type, data=transplant7[labels(beta_div_neutral_transplant7$S),], permutations=999, strata=transplant7$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 8 7.284378 0.3492417 4.293351 0.001
Residual 64 13.573319 0.6507583 NA NA
Total 72 20.857698 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_neutral_transplant7$S,transplant7_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.23160196 0.7712905 0.045988741 0.729 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.40153474 5.7562378 0.264578733 0.001 0.015 .
Control.1_Acclimation vs Control.Transplant 1 0.56111203 2.5583085 0.092832565 0.002 0.030 .
Control.1_Acclimation vs Treatment.Transplant 1 1.88709838 8.3257794 0.293929402 0.001 0.015 .
Control.1_Acclimation vs Hot_control.Transplant 1 2.02585000 9.2317432 0.295588471 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.63477039 6.8326887 0.299250291 0.001 0.015 .
Treatment.1_Acclimation vs Control.Transplant 1 0.61335323 2.8313912 0.101733730 0.002 0.030 .
Treatment.1_Acclimation vs Treatment.Transplant 1 2.10939140 9.4473664 0.320822116 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.Transplant 1 2.24827218 10.3907678 0.320794118 0.001 0.015 .
Hot_control.1_Acclimation vs Control.Transplant 1 1.87351542 10.3925002 0.293635661 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.Transplant 1 0.34276062 1.9273510 0.087897118 0.057 0.855
Hot_control.1_Acclimation vs Hot_control.Transplant 1 0.31638309 1.8072337 0.075911118 0.069 1.000
Control.Transplant vs Treatment.Transplant 1 2.48701901 14.0199769 0.325894571 0.001 0.015 .
Control.Transplant vs Hot_control.Transplant 1 2.75304261 15.6912860 0.336064549 0.001 0.015 .
Treatment.Transplant vs Hot_control.Transplant 1 0.01764676 0.1022118 0.003915827 0.996 1.000
4.3.2.7.3 Phylogenetic
adonis2(formula=beta_div_phylo_transplant7$S ~ Population+time_point+type, data=transplant7[labels(beta_div_phylo_transplant7$S),], permutations=999, strata=transplant7$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 4 0.7377029 0.1879202 3.933904 0.023
Residual 68 3.1879143 0.8120798 NA NA
Total 72 3.9256172 1.0000000 NA NA
pairwise<-pairwise.adonis(beta_div_phylo_transplant7$S,transplant7_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.04186923 0.43916424 0.026714511 0.737 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 0.15609416 2.55468892 0.137684276 0.038 0.570
Control.1_Acclimation vs Control.Transplant 1 0.03888650 0.83961027 0.032493148 0.462 1.000
Control.1_Acclimation vs Treatment.Transplant 1 0.28946588 4.58406811 0.186464994 0.001 0.015 .
Control.1_Acclimation vs Hot_control.Transplant 1 0.31864880 5.37781508 0.196429666 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 0.23108846 4.05218385 0.202081922 0.005 0.075
Treatment.1_Acclimation vs Control.Transplant 1 0.11794420 2.69844074 0.097422117 0.051 0.765
Treatment.1_Acclimation vs Treatment.Transplant 1 0.37640156 6.28511923 0.239113210 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.Transplant 1 0.40433696 7.18306079 0.246138020 0.001 0.015 .
Hot_control.1_Acclimation vs Control.Transplant 1 0.11597038 5.32063275 0.175478948 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.Transplant 1 0.03673004 1.13023077 0.053488804 0.336 1.000
Hot_control.1_Acclimation vs Hot_control.Transplant 1 0.04097680 1.30539166 0.056012432 0.301 1.000
Control.Transplant vs Treatment.Transplant 1 0.21736741 7.59281199 0.207494630 0.001 0.015 .
Control.Transplant vs Hot_control.Transplant 1 0.25837791 9.19762187 0.228810100 0.001 0.015 .
Treatment.Transplant vs Hot_control.Transplant 1 0.00180330 0.04804393 0.001844435 0.966 1.000
beta_richness_nmds_transplant7 <- beta_div_richness_transplant7$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(transplant7_nmds, by = join_by(sample == newID))

beta_neutral_nmds_transplant7 <- beta_div_neutral_transplant7$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(transplant7_nmds, by = join_by(sample == newID))

beta_phylo_nmds_transplant7 <- beta_div_phylo_transplant7$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(transplant7_nmds, by = join_by(sample == newID))
p0<-beta_richness_nmds_transplant7 %>%
  group_by(type) %>%
  mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
  mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
  ungroup() %>%
  ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
  scale_color_manual(name="Type",
                     breaks=c("Control", "Hot_control", "Treatment"),
                     labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                     values=c("#4477AA","#d57d2c","#76b183")) +
  scale_shape_manual(name="time_point",
                     breaks=c("1_Acclimation", "3_Transplant1", "4_Transplant2"),
                     labels=c("Acclimation", "Transplant", "Transplant"),
                     values=c("circle","square","square")) +
  geom_point(size=2) +
  geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
  labs(y = "NMDS2", x="NMDS1 \n Richness beta diversity") +
  theme_classic() +
  theme(legend.position="none")

p1<-beta_neutral_nmds_transplant7 %>%
  group_by(type) %>%
  mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
  mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
  ungroup() %>%
  ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
  scale_color_manual(name="Type",
                     breaks=c("Control", "Hot_control", "Treatment"),
                     labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                     values=c("#4477AA","#d57d2c","#76b183")) +
  scale_shape_manual(name="time_point",
                     breaks=c("1_Acclimation", "3_Transplant1", "4_Transplant2"),
                     labels=c("Acclimation", "Transplant", "Transplant"),
                     values=c("circle","square","square")) +
  geom_point(size=2) +
  geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
  labs(y= element_blank (), x="NMDS1 \n Neutral beta diversity") +
  theme_classic() +
  theme(legend.position="none")

p2<-beta_phylo_nmds_transplant7 %>%
  group_by(type) %>%
  mutate(x_cen = mean(NMDS1, na.rm = TRUE)) %>%
  mutate(y_cen = mean(NMDS2, na.rm = TRUE)) %>%
  ungroup() %>%
  ggplot(., aes(x=NMDS1,y=NMDS2, color=type, shape=time_point)) +
  scale_color_manual(name="Type",
                     breaks=c("Control", "Hot_control", "Treatment"),
                     labels=c("Cold-Cold", "Hot-Hot", "Cold-Hot"),
                     values=c("#4477AA","#d57d2c","#76b183")) +
  scale_shape_manual(name="time_point",
                     breaks=c("1_Acclimation", "3_Transplant1", "4_Transplant2"),
                     labels=c("Acclimation", "Transplant", "Transplant"),
                     values=c("circle","square","square")) +
  geom_point(size=2) +
  geom_segment(aes(x=x_cen, y=y_cen, xend=NMDS1, yend=NMDS2), alpha=0.2) +
  labs(y= element_blank (), x="NMDS1 \n Phylogenetic beta diversity") +
  theme_classic() +
  theme(legend.position="none")

4.3.2.8 Comparison between Acclimation vs Post-FMT1

post3 <- meta  %>%
  filter(time_point == "1_Acclimation" | time_point == "5_Post-FMT1")

temp_genome_counts <- transform(genome_counts_filt, row.names = genome_counts_filt$genome)
temp_genome_counts$genome <- NULL

post3.counts <- temp_genome_counts[,which(colnames(temp_genome_counts) %in% rownames(post3))]
identical(sort(colnames(post3.counts)),sort(as.character(rownames(post3))))

post3_nmds <- sample_metadata %>%
  filter(time_point == "1_Acclimation" | time_point == "5_Post-FMT1")

4.3.2.9 Number of samples used

[1] 53
beta_div_richness_post3<-hillpair(data=post3.counts, q=0)
beta_div_neutral_post3<-hillpair(data=post3.counts, q=1)
beta_div_phylo_post3<-hillpair(data=post3.counts, q=1, tree=genome_tree)
#Arrange of metadata dataframe
post3_arrange<-post3[labels(beta_div_neutral_post3$S),]
post3_arrange$type_time <- interaction(post3_arrange$type, post3_arrange$time_point)
4.3.2.9.1 Richness
betadisper(beta_div_richness_post3$S, post3_arrange$type) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df   Sum Sq  Mean Sq      F N.Perm Pr(>F)   
Groups     2 0.099607 0.049803 9.5441    999  0.002 **
Residuals 50 0.260911 0.005218                        
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
               Control Hot_control Treatment
Control                 0.00200000     0.900
Hot_control 0.00102653                 0.001
Treatment   0.88832670  0.00010131          
adonis2(formula=beta_div_richness_post3$S ~ time_point*Population, data=post3[labels(beta_div_neutral_post3$S),], permutations=999,strata=post3$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 3.479739 0.1872879 3.763983 0.001
Residual 49 15.099892 0.8127121 NA NA
Total 52 18.579631 1.0000000 NA NA
pairwise <- pairwise.adonis(beta_div_richness_post3$S, post3_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.3620815 1.052109 0.06169963 0.331 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.2800877 4.605444 0.22350616 0.001 0.015 .
Control.1_Acclimation vs Control.5_Post-FMT1 1 0.6845657 1.998114 0.11101796 0.002 0.030 .
Control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.8437461 2.499232 0.14281954 0.001 0.015 .
Control.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.1208022 3.568670 0.18236649 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.3606630 5.087152 0.24124415 0.001 0.015 .
Treatment.1_Acclimation vs Control.5_Post-FMT1 1 0.7216200 2.172734 0.11956009 0.001 0.015 .
Treatment.1_Acclimation vs Treatment.5_Post-FMT1 1 0.9551308 2.926054 0.16322910 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.2263345 4.039487 0.20157637 0.001 0.015 .
Hot_control.1_Acclimation vs Control.5_Post-FMT1 1 1.4319792 5.384836 0.25180628 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.8172413 3.194690 0.17558364 0.001 0.015 .
Hot_control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.5796135 2.441615 0.13239702 0.001 0.015 .
Control.5_Post-FMT1 vs Treatment.5_Post-FMT1 1 0.5615418 1.729004 0.10335366 0.017 0.255
Control.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.8438429 2.793772 0.14865413 0.001 0.015 .
Treatment.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.3734921 1.268929 0.07799710 0.115 1.000
4.3.2.9.2 Neutral
betadisper(beta_div_neutral_post3$S, post3$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df  Sum Sq   Mean Sq      F N.Perm Pr(>F)
Groups     1 0.00945 0.0094472 1.1428    999  0.314
Residuals 51 0.42161 0.0082669                     

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 5_Post-FMT1
1_Acclimation                     0.302
5_Post-FMT1          0.2901            
adonis2(formula=beta_div_neutral_post3$S ~ time_point*Population, data=post3[labels(beta_div_neutral_post3$S),], permutations=999,strata=post3$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 4.465574 0.2549304 5.588555 0.001
Residual 49 13.051264 0.7450696 NA NA
Total 52 17.516838 1.0000000 NA NA
pairwise <- pairwise.adonis(beta_div_neutral_post3$S, post3_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.2316020 0.7712905 0.04598874 0.725 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.4015347 5.7562378 0.26457873 0.001 0.015 .
Control.1_Acclimation vs Control.5_Post-FMT1 1 0.8332162 2.9081103 0.15380227 0.001 0.015 .
Control.1_Acclimation vs Treatment.5_Post-FMT1 1 1.1719595 4.0685514 0.21336447 0.001 0.015 .
Control.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.4260875 5.2413171 0.24675104 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.6347704 6.8326887 0.29925029 0.001 0.015 .
Treatment.1_Acclimation vs Control.5_Post-FMT1 1 0.9517634 3.3715700 0.17404733 0.001 0.015 .
Treatment.1_Acclimation vs Treatment.5_Post-FMT1 1 1.3127773 4.6298256 0.23585668 0.002 0.030 .
Treatment.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.6713369 6.2395460 0.28056085 0.001 0.015 .
Hot_control.1_Acclimation vs Control.5_Post-FMT1 1 1.5409781 6.8338056 0.29928456 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.9133614 4.0964534 0.21451383 0.001 0.015 .
Hot_control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.6954835 3.2951234 0.17077493 0.001 0.015 .
Control.5_Post-FMT1 vs Treatment.5_Post-FMT1 1 0.6051778 2.2508491 0.13047758 0.012 0.180
Control.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 1.0528902 4.1436369 0.20570451 0.001 0.015 .
Treatment.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.4150076 1.6372683 0.09840968 0.040 0.600
4.3.2.9.3 Phylogenetic
betadisper(beta_div_phylo_post3$S, post3$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df  Sum Sq  Mean Sq      F N.Perm Pr(>F)
Groups     1 0.05132 0.051320 2.6745    999  0.122
Residuals 51 0.97861 0.019189                     

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 5_Post-FMT1
1_Acclimation                     0.116
5_Post-FMT1         0.10812            
adonis2(formula=beta_div_phylo_post3$S ~ time_point*Population, data=post3[labels(beta_div_phylo_post3$S),], permutations=999,strata=post3$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 0.7332141 0.2105602 4.356444 0.001
Residual 49 2.7489923 0.7894398 NA NA
Total 52 3.4822065 1.0000000 NA NA
pairwise <- pairwise.adonis(beta_div_phylo_post3$S, post3_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.04186923 0.4391642 0.02671451 0.752 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 0.15609416 2.5546889 0.13768428 0.050 0.750
Control.1_Acclimation vs Control.5_Post-FMT1 1 0.19193367 2.9749922 0.15678490 0.019 0.285
Control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.14627288 1.7907381 0.10665035 0.134 1.000
Control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.25061348 3.6146185 0.18428187 0.013 0.195
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 0.23108846 4.0521838 0.20208192 0.005 0.075
Treatment.1_Acclimation vs Control.5_Post-FMT1 1 0.26358465 4.3608960 0.21417997 0.006 0.090
Treatment.1_Acclimation vs Treatment.5_Post-FMT1 1 0.25319427 3.2738422 0.17915456 0.040 0.600
Treatment.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.39050120 5.9837393 0.27218933 0.001 0.015 .
Hot_control.1_Acclimation vs Control.5_Post-FMT1 1 0.14203376 5.4200212 0.25303529 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.09666753 2.3682173 0.13635351 0.013 0.195
Hot_control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.09252600 2.9824958 0.15711821 0.007 0.105
Control.5_Post-FMT1 vs Treatment.5_Post-FMT1 1 0.01842535 0.4144162 0.02688498 0.757 1.000
Control.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.05987967 1.7387847 0.09802164 0.131 1.000
Treatment.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.03212966 0.6477782 0.04139746 0.700 1.000
beta_richness_nmds_post3 <- beta_div_richness_post3$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(post3_nmds, by = c("sample" = "Tube_code"))

beta_neutral_nmds_post3 <- beta_div_neutral_post3$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(post3_nmds, by = c("sample" = "Tube_code"))

beta_phylo_nmds_post3 <- beta_div_phylo_post3$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(post3_nmds, by = join_by(sample == Tube_code))

4.3.2.10 Comparison between Acclimation vs Post-FMT2

post4 <- meta  %>%
  filter(time_point == "1_Acclimation" | time_point == "6_Post-FMT2")

temp_genome_counts <- transform(genome_counts_filt, row.names = genome_counts_filt$genome)
temp_genome_counts$genome <- NULL

post4.counts <- temp_genome_counts[,which(colnames(temp_genome_counts) %in% rownames(post4))]
identical(sort(colnames(post4.counts)),sort(as.character(rownames(post4))))

post4_nmds <- sample_metadata %>%
  filter(time_point == "1_Acclimation" | time_point == "6_Post-FMT2")

4.3.2.11 Number of samples used

[1] 54
beta_div_richness_post4<-hillpair(data=post4.counts, q=0)
beta_div_neutral_post4<-hillpair(data=post4.counts, q=1)
beta_div_phylo_post4<-hillpair(data=post4.counts, q=1, tree=genome_tree)
#Arrange of metadata dataframe
post4_arrange<-post4[labels(beta_div_neutral_post4$S),]
post4_arrange$type_time <- interaction(post4_arrange$type, post4_arrange$time_point)
4.3.2.11.1 Richness
betadisper(beta_div_richness_post4$S, post4_arrange$type) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df  Sum Sq  Mean Sq      F N.Perm Pr(>F)  
Groups     2 0.06809 0.034047 3.8471    999  0.025 *
Residuals 51 0.45135 0.008850                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              Control Hot_control Treatment
Control                 0.0290000     0.859
Hot_control 0.0349385                 0.005
Treatment   0.8855174   0.0047257          
adonis2(formula=beta_div_richness_post4$S ~ time_point*Population, data=post4[labels(beta_div_richness_post4$S),], permutations=999,strata=post4$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 3.310172 0.1883377 3.867324 0.001
Residual 50 14.265560 0.8116623 NA NA
Total 53 17.575732 1.0000000 NA NA
pairwise <- pairwise.adonis(beta_div_richness_post4$S, post4_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.3620815 1.052109 0.06169963 0.345 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.2800877 4.605444 0.22350616 0.001 0.015 .
Control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.8430295 2.845779 0.15100353 0.001 0.015 .
Control.1_Acclimation vs Control.6_Post-FMT2 1 0.5232174 1.683240 0.09518843 0.025 0.375
Control.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.1217138 3.634271 0.18509835 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.3606630 5.087152 0.24124415 0.001 0.015 .
Treatment.1_Acclimation vs Treatment.6_Post-FMT2 1 0.9130048 3.195028 0.16645080 0.001 0.015 .
Treatment.1_Acclimation vs Control.6_Post-FMT2 1 0.5959230 1.984036 0.11032208 0.002 0.030 .
Treatment.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.2747787 4.275366 0.21086503 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.6397330 2.913695 0.15405213 0.001 0.015 .
Hot_control.1_Acclimation vs Control.6_Post-FMT2 1 1.4575447 6.224524 0.28007456 0.001 0.015 .
Hot_control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.3276169 1.412318 0.08111028 0.046 0.690
Treatment.6_Post-FMT2 vs Control.6_Post-FMT2 1 0.6463814 2.560441 0.13795154 0.001 0.015 .
Treatment.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.4796256 1.916520 0.10696943 0.001 0.015 .
Control.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 1.1305044 4.268317 0.21059061 0.001 0.015 .
4.3.2.11.2 Neutral
betadisper(beta_div_neutral_post4$S, post4_arrange$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df  Sum Sq   Mean Sq      F N.Perm Pr(>F)
Groups     1 0.01544 0.0154447 2.0972    999  0.144
Residuals 52 0.38294 0.0073643                     

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 6_Post-FMT2
1_Acclimation                     0.158
6_Post-FMT2         0.15357            
adonis2(formula=beta_div_neutral_post4$S ~ time_point*Population, data=post4[labels(beta_div_neutral_post4$S),], permutations=999,strata=post4$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 3.863228 0.229321 4.959284 0.001
Residual 50 12.983151 0.770679 NA NA
Total 53 16.846379 1.000000 NA NA
pairwise <- pairwise.adonis(beta_div_neutral_post4$S, post4_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.2316020 0.7712905 0.04598874 0.722 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.4015347 5.7562378 0.26457873 0.001 0.015 .
Control.1_Acclimation vs Treatment.6_Post-FMT2 1 1.1746426 4.5564741 0.22165640 0.001 0.015 .
Control.1_Acclimation vs Control.6_Post-FMT2 1 0.5286441 1.9819408 0.11021840 0.003 0.045 .
Control.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.3443224 4.9104417 0.23483204 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.6347704 6.8326887 0.29925029 0.002 0.030 .
Treatment.1_Acclimation vs Treatment.6_Post-FMT2 1 1.3540292 5.3398081 0.25022756 0.001 0.015 .
Treatment.1_Acclimation vs Control.6_Post-FMT2 1 0.6311089 2.4041625 0.13063146 0.001 0.015 .
Treatment.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.6125755 5.9825981 0.27215155 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.6202327 3.1519868 0.16457754 0.001 0.015 .
Hot_control.1_Acclimation vs Control.6_Post-FMT2 1 1.5701179 7.6327037 0.32297209 0.002 0.030 .
Hot_control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.3634438 1.7083388 0.09647087 0.028 0.420
Treatment.6_Post-FMT2 vs Control.6_Post-FMT2 1 1.0227481 4.6483346 0.22511910 0.001 0.015 .
Treatment.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.5010202 2.2065321 0.12119453 0.002 0.030 .
Control.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 1.3619424 5.7710313 0.26507845 0.001 0.015 .
4.3.2.11.3 Phylogenetic
betadisper(beta_div_phylo_post4$S, post4$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
          Df  Sum Sq  Mean Sq      F N.Perm Pr(>F)  
Groups     1 0.06978 0.069777 5.0345    999  0.022 *
Residuals 52 0.72071 0.013860                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 6_Post-FMT2
1_Acclimation                     0.016
6_Post-FMT2        0.029131            
adonis2(formula=beta_div_phylo_post4$S ~ time_point*Population, data=post4[labels(beta_div_phylo_post4$S),], permutations=999,strata=post4$individual) %>%
  as.matrix() %>%
  kable()
Df SumOfSqs R2 F Pr(>F)
Model 3 0.757493 0.2376349 5.195124 0.001
Residual 50 2.430141 0.7623651 NA NA
Total 53 3.187634 1.0000000 NA NA
pairwise <- pairwise.adonis(beta_div_phylo_post4$S, post4_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.04186923 0.4391642 0.02671451 0.752 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 0.15609416 2.5546889 0.13768428 0.043 0.645
Control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.26322331 4.3060281 0.21205664 0.003 0.045 .
Control.1_Acclimation vs Control.6_Post-FMT2 1 0.16047895 2.5405742 0.13702781 0.039 0.585
Control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.25529510 4.0109138 0.20043631 0.003 0.045 .
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 0.23108846 4.0521838 0.20208192 0.004 0.060
Treatment.1_Acclimation vs Treatment.6_Post-FMT2 1 0.36496892 6.3966666 0.28560797 0.002 0.030 .
Treatment.1_Acclimation vs Control.6_Post-FMT2 1 0.22628210 3.8292220 0.19311005 0.019 0.285
Treatment.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.34830814 5.8463335 0.26761166 0.001 0.015 .
Hot_control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.10002871 4.3836237 0.21505615 0.001 0.015 .
Hot_control.1_Acclimation vs Control.6_Post-FMT2 1 0.12577510 5.0601287 0.24027055 0.001 0.015 .
Hot_control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.06334378 2.4997737 0.13512455 0.027 0.405
Treatment.6_Post-FMT2 vs Control.6_Post-FMT2 1 0.05927454 2.3820253 0.12958449 0.033 0.495
Treatment.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.06906280 2.7224602 0.14541146 0.003 0.045 .
Control.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.11081709 4.0436561 0.20174244 0.002 0.030 .
beta_richness_nmds_post4 <- beta_div_richness_post4$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(post4_nmds, by = c("sample" = "Tube_code"))

beta_neutral_nmds_post4 <- beta_div_neutral_post4$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(post4_nmds, by = c("sample" = "Tube_code"))

beta_phylo_nmds_post4 <- beta_div_phylo_post4$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(post4_nmds, by = join_by(sample == Tube_code))

4.3.2.12 All time comparison

all_comparison <- sample_metadata  %>%
  filter(time_point == "1_Acclimation" | time_point == "5_Post-FMT1"| time_point == "6_Post-FMT2"| time_point == "2_Antibiotics"| time_point == "3_Transplant1"| time_point == "4_Transplant2")%>%
  mutate(Tube_code=str_remove_all(Tube_code, "_a"))

all_comparison$newID <- paste(all_comparison$Tube_code, "_", all_comparison$individual)

all_comparison_data<-all_comparison%>%
  filter(Tube_code != "AD45_a") %>%
  filter(Tube_code != "AD48_a") %>%
  #mutate(newID=str_remove_all(newID, "_a")) %>%
  column_to_rownames("newID")

all_comparison_nmds <- sample_metadata %>%
  filter(time_point =="1_Acclimation" | time_point == "5_Post-FMT1"| time_point == "6_Post-FMT2"| time_point == "2_Antibiotics"| time_point == "3_Transplant1"| time_point == "4_Transplant2") %>%
  filter(Tube_code != "AD45_a"| Tube_code != "AD48_a")

all_comparison_nmds$newID <- paste(all_comparison_nmds$Tube_code, "_", all_comparison_nmds$individual)

full_counts_new<-temp_genome_counts %>%
    t()%>%
    as.data.frame()%>%
    rownames_to_column("Tube_code")%>%
    full_join(all_comparison,by = join_by(Tube_code == Tube_code))

comparison_all_counts<-full_counts_new %>%
  filter(time_point == "1_Acclimation" | time_point == "5_Post-FMT1"| time_point == "6_Post-FMT2"| time_point == "2_Antibiotics"| time_point == "3_Transplant1"| time_point == "4_Transplant2") %>%
  subset(select=-c(315:324)) %>%
  column_to_rownames("newID")%>%
  subset(select=-c(1))%>%
  t() %>%
  as.data.frame() %>%
  mutate_if(is.character, as.numeric) %>%
  subset(select=-c(150:151))

identical(sort(colnames(comparison_all_counts)),sort(as.character(rownames(all_comparison))))
beta_div_richness_all_comparison<-hillpair(data=comparison_all_counts, q=0)
beta_div_neutral_all_comparison<-hillpair(data=comparison_all_counts, q=1)
beta_div_phylo_all_comparison<-hillpair(data=comparison_all_counts, q=1, tree=genome_tree)
#Arrange of metadata dataframe
all_comparison_arrange<-all_comparison_data[labels(beta_div_neutral_all_comparison$S),]
all_comparison_arrange$type_time <- interaction(all_comparison_arrange$type, all_comparison_arrange$time_point)
4.3.2.12.1 Richness
betadisper(beta_div_richness_all_comparison$S, all_comparison_arrange$type) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
           Df  Sum Sq  Mean Sq      F N.Perm Pr(>F)  
Groups      2 0.09854 0.049271 3.9422    999  0.019 *
Residuals 146 1.82474 0.012498                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              Control Hot_control Treatment
Control                 0.0330000     0.534
Hot_control 0.0359859                 0.011
Treatment   0.5501317   0.0097545          
#(formula=beta_div_richness_all_comparison$S ~ time_point*type, data=all_comparison_data[labels(beta_div_richness_all_comparison$S),], permutations=999,strata=all_comparison_data$individual) %>%
  #as.matrix() %>%
  #kable()
pairwise <- pairwise.adonis(beta_div_richness_all_comparison$S, all_comparison_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.362081458 1.05210877 0.061699628 0.335 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.280087737 4.60544357 0.223506160 0.001 0.153
Control.1_Acclimation vs Control.2_Antibiotics 1 1.011407380 2.82990350 0.158716703 0.001 0.153
Control.1_Acclimation vs Treatment.2_Antibiotics 1 0.920434738 2.46321443 0.149619289 0.003 0.459
Control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.373846937 4.00511266 0.210738696 0.001 0.153
Control.1_Acclimation vs Control.3_Transplant1 1 0.488555082 1.74347500 0.098260065 0.014 1.000
Control.1_Acclimation vs Treatment.3_Transplant1 1 1.211627129 4.33073710 0.236255481 0.001 0.153
Control.1_Acclimation vs Hot_control.3_Transplant1 1 1.314649861 4.86501559 0.244903688 0.001 0.153
Control.1_Acclimation vs Control.4_Transplant2 1 0.402848480 1.44978255 0.083083130 0.066 1.000
Control.1_Acclimation vs Treatment.4_Transplant2 1 1.132799430 3.99953382 0.235273147 0.002 0.306
Control.1_Acclimation vs Hot_control.4_Transplant2 1 1.239570207 4.51495838 0.243854633 0.001 0.153
Control.1_Acclimation vs Control.5_Post-FMT1 1 0.684565686 1.99811396 0.111017964 0.001 0.153
Control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.843746089 2.49923230 0.142819539 0.001 0.153
Control.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.120802205 3.56866951 0.182366487 0.001 0.153
Control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.843029506 2.84577913 0.151003527 0.001 0.153
Control.1_Acclimation vs Control.6_Post-FMT2 1 0.523217385 1.68323982 0.095188429 0.027 1.000
Control.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.121713759 3.63427125 0.185098352 0.002 0.306
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.360662985 5.08715202 0.241244148 0.001 0.153
Treatment.1_Acclimation vs Control.2_Antibiotics 1 0.970703875 2.80371407 0.157479167 0.001 0.153
Treatment.1_Acclimation vs Treatment.2_Antibiotics 1 0.827773826 2.28859986 0.140503167 0.005 0.765
Treatment.1_Acclimation vs Hot_control.2_Antibiotics 1 1.455154159 4.38505425 0.226207995 0.001 0.153
Treatment.1_Acclimation vs Control.3_Transplant1 1 0.481272253 1.78421716 0.100325876 0.003 0.459
Treatment.1_Acclimation vs Treatment.3_Transplant1 1 1.312567757 4.90136959 0.259312933 0.001 0.153
Treatment.1_Acclimation vs Hot_control.3_Transplant1 1 1.417501836 5.47200891 0.267292230 0.001 0.153
Treatment.1_Acclimation vs Control.4_Transplant2 1 0.377460322 1.41165944 0.081075525 0.086 1.000
Treatment.1_Acclimation vs Treatment.4_Transplant2 1 1.238098167 4.57988771 0.260518599 0.001 0.153
Treatment.1_Acclimation vs Hot_control.4_Transplant2 1 1.348911044 5.13734533 0.268446080 0.001 0.153
Treatment.1_Acclimation vs Control.5_Post-FMT1 1 0.721620019 2.17273370 0.119560092 0.001 0.153
Treatment.1_Acclimation vs Treatment.5_Post-FMT1 1 0.955130770 2.92605353 0.163229097 0.001 0.153
Treatment.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.226334542 4.03948698 0.201576367 0.001 0.153
Treatment.1_Acclimation vs Treatment.6_Post-FMT2 1 0.913004785 3.19502772 0.166450800 0.001 0.153
Treatment.1_Acclimation vs Control.6_Post-FMT2 1 0.595923023 1.98403628 0.110322079 0.002 0.306
Treatment.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.274778685 4.27536566 0.210865033 0.001 0.153
Hot_control.1_Acclimation vs Control.2_Antibiotics 1 1.734607158 6.29369579 0.295566155 0.001 0.153
Hot_control.1_Acclimation vs Treatment.2_Antibiotics 1 1.563478726 5.46593706 0.280794962 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.232843872 4.71931579 0.239324520 0.001 0.153
Hot_control.1_Acclimation vs Control.3_Transplant1 1 1.296297619 6.36871987 0.284715438 0.001 0.153
Hot_control.1_Acclimation vs Treatment.3_Transplant1 1 0.220244257 1.14625733 0.075679246 0.282 1.000
Hot_control.1_Acclimation vs Hot_control.3_Transplant1 1 0.224204694 1.18982182 0.073491965 0.235 1.000
Hot_control.1_Acclimation vs Control.4_Transplant2 1 1.399239883 6.95480534 0.302978189 0.001 0.153
Hot_control.1_Acclimation vs Treatment.4_Transplant2 1 0.216302837 1.14530694 0.080967274 0.261 1.000
Hot_control.1_Acclimation vs Hot_control.4_Transplant2 1 0.196664515 1.05215668 0.069900726 0.365 1.000
Hot_control.1_Acclimation vs Control.5_Post-FMT1 1 1.431979200 5.38483613 0.251806284 0.001 0.153
Hot_control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.817241324 3.19468982 0.175583637 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.579613496 2.44161478 0.132397016 0.001 0.153
Hot_control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.639732962 2.91369490 0.154052125 0.001 0.153
Hot_control.1_Acclimation vs Control.6_Post-FMT2 1 1.457544655 6.22452356 0.280074556 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.327616900 1.41231806 0.081110284 0.033 1.000
Control.2_Antibiotics vs Treatment.2_Antibiotics 1 0.300761563 0.79496206 0.057626984 0.809 1.000
Control.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.097851301 3.18067161 0.185130808 0.001 0.153
Control.2_Antibiotics vs Control.3_Transplant1 1 1.540776008 5.54176964 0.269780537 0.001 0.153
Control.2_Antibiotics vs Treatment.3_Transplant1 1 1.711923036 6.17547381 0.322050650 0.001 0.153
Control.2_Antibiotics vs Hot_control.3_Transplant1 1 1.841780800 6.89378453 0.329944272 0.002 0.306
Control.2_Antibiotics vs Control.4_Transplant2 1 1.511441382 5.48573893 0.267783308 0.001 0.153
Control.2_Antibiotics vs Treatment.4_Transplant2 1 1.612594527 5.74394061 0.323712795 0.001 0.153
Control.2_Antibiotics vs Hot_control.4_Transplant2 1 1.739395066 6.40461266 0.330056197 0.001 0.153
Control.2_Antibiotics vs Control.5_Post-FMT1 1 0.971238688 2.81865279 0.158185516 0.001 0.153
Control.2_Antibiotics vs Treatment.5_Post-FMT1 1 1.190641768 3.50854402 0.200390393 0.001 0.153
Control.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.551250242 4.93817626 0.247674421 0.001 0.153
Control.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.490970612 5.05213442 0.251949958 0.001 0.153
Control.2_Antibiotics vs Control.6_Post-FMT2 1 1.198436711 3.85732325 0.204553064 0.001 0.153
Control.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.546155402 5.01421139 0.250532549 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.069552526 2.95663926 0.185292104 0.001 0.153
Treatment.2_Antibiotics vs Control.3_Transplant1 1 1.332989733 4.61829348 0.248051385 0.001 0.153
Treatment.2_Antibiotics vs Treatment.3_Transplant1 1 1.516514105 5.23811421 0.303868169 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.3_Transplant1 1 1.623847037 5.84647092 0.310215687 0.001 0.153
Treatment.2_Antibiotics vs Control.4_Transplant2 1 1.316537672 4.60415208 0.247479813 0.001 0.153
Treatment.2_Antibiotics vs Treatment.4_Transplant2 1 1.438049740 4.88320766 0.307444678 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.4_Transplant2 1 1.548346381 5.46312423 0.312837735 0.001 0.153
Treatment.2_Antibiotics vs Control.5_Post-FMT1 1 0.802328938 2.22911438 0.137352805 0.004 0.612
Treatment.2_Antibiotics vs Treatment.5_Post-FMT1 1 0.974454304 2.74115182 0.174139215 0.002 0.306
Treatment.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.304972399 3.98688766 0.221655227 0.001 0.153
Treatment.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.278825644 4.16636433 0.229344973 0.001 0.153
Treatment.2_Antibiotics vs Control.6_Post-FMT2 1 1.017603829 3.14437063 0.183405428 0.002 0.306
Treatment.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.369140221 4.26359194 0.233447613 0.001 0.153
Hot_control.2_Antibiotics vs Control.3_Transplant1 1 1.825343641 6.92328189 0.315795871 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.3_Transplant1 1 1.275008094 4.89212161 0.273423226 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.3_Transplant1 1 1.365719305 5.42464757 0.279266203 0.001 0.153
Hot_control.2_Antibiotics vs Control.4_Transplant2 1 1.871048444 7.16478012 0.323250674 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.4_Transplant2 1 1.264776297 4.81313017 0.286272105 0.002 0.306
Hot_control.2_Antibiotics vs Hot_control.4_Transplant2 1 1.336062206 5.23953594 0.287262569 0.001 0.153
Hot_control.2_Antibiotics vs Control.5_Post-FMT1 1 1.256421540 3.80504531 0.202341725 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.5_Post-FMT1 1 1.042883208 3.21925840 0.186956855 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.118057885 3.72987362 0.199140352 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.393703594 4.96438715 0.248662136 0.001 0.153
Hot_control.2_Antibiotics vs Control.6_Post-FMT2 1 1.578393989 5.32675023 0.262056166 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.187086833 4.03801261 0.212102633 0.001 0.153
Control.3_Transplant1 vs Treatment.3_Transplant1 1 1.129362662 5.79950801 0.292911723 0.001 0.153
Control.3_Transplant1 vs Hot_control.3_Transplant1 1 1.208865861 6.33395382 0.296895450 0.001 0.153
Control.3_Transplant1 vs Control.4_Transplant2 1 0.131647583 0.64704882 0.038868680 0.872 1.000
Control.3_Transplant1 vs Treatment.4_Transplant2 1 1.120646022 5.84730567 0.310246237 0.001 0.153
Control.3_Transplant1 vs Hot_control.4_Transplant2 1 1.223919777 6.45841493 0.315685010 0.001 0.153
Control.3_Transplant1 vs Control.5_Post-FMT1 1 0.859252354 3.20381975 0.166832422 0.001 0.153
Control.3_Transplant1 vs Treatment.5_Post-FMT1 1 1.027552599 3.97918760 0.209660586 0.001 0.153
Control.3_Transplant1 vs Hot_control.5_Post-FMT1 1 1.201969568 5.01536301 0.238652219 0.001 0.153
Control.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.813822425 3.66869509 0.186524580 0.002 0.306
Control.3_Transplant1 vs Control.6_Post-FMT2 1 0.635206288 2.68665949 0.143774198 0.001 0.153
Control.3_Transplant1 vs Hot_control.6_Post-FMT2 1 1.251952139 5.34475979 0.250401496 0.001 0.153
Treatment.3_Transplant1 vs Hot_control.3_Transplant1 1 0.009102921 0.05153754 0.003948772 1.000 1.000
Treatment.3_Transplant1 vs Control.4_Transplant2 1 1.314300451 6.84362433 0.328331782 0.001 0.153
Treatment.3_Transplant1 vs Treatment.4_Transplant2 1 0.074927876 0.42820379 0.037469037 0.977 1.000
Treatment.3_Transplant1 vs Hot_control.4_Transplant2 1 0.077903563 0.44805710 0.035994139 0.950 1.000
Treatment.3_Transplant1 vs Control.5_Post-FMT1 1 1.353702886 5.08846981 0.266572955 0.001 0.153
Treatment.3_Transplant1 vs Treatment.5_Post-FMT1 1 0.791197505 3.11042526 0.193069097 0.002 0.306
Treatment.3_Transplant1 vs Hot_control.5_Post-FMT1 1 0.536176861 2.29706971 0.140949861 0.006 0.918
Treatment.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.621029781 2.91505641 0.172335010 0.002 0.306
Treatment.3_Transplant1 vs Control.6_Post-FMT2 1 1.331819749 5.79735453 0.292834809 0.001 0.153
Treatment.3_Transplant1 vs Hot_control.6_Post-FMT2 1 0.417936103 1.83930234 0.116122686 0.005 0.765
Hot_control.3_Transplant1 vs Control.4_Transplant2 1 1.410186386 7.48716456 0.332952807 0.001 0.153
Hot_control.3_Transplant1 vs Treatment.4_Transplant2 1 0.077823551 0.45304555 0.036380301 0.961 1.000
Hot_control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.067817527 0.39659721 0.029604324 0.980 1.000
Hot_control.3_Transplant1 vs Control.5_Post-FMT1 1 1.469262870 5.70807523 0.275644895 0.001 0.153
Hot_control.3_Transplant1 vs Treatment.5_Post-FMT1 1 0.865197810 3.51773013 0.200809700 0.001 0.153
Hot_control.3_Transplant1 vs Hot_control.5_Post-FMT1 1 0.610686942 2.69073097 0.152098349 0.003 0.459
Hot_control.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.678638979 3.26359386 0.178693957 0.001 0.153
Hot_control.3_Transplant1 vs Control.6_Post-FMT2 1 1.439165056 6.43874075 0.300332040 0.001 0.153
Hot_control.3_Transplant1 vs Hot_control.6_Post-FMT2 1 0.458703763 2.07389437 0.121465808 0.004 0.612
Control.4_Transplant2 vs Treatment.4_Transplant2 1 1.248404869 6.61377735 0.337200593 0.001 0.153
Control.4_Transplant2 vs Hot_control.4_Transplant2 1 1.357472348 7.26616675 0.341677315 0.001 0.153
Control.4_Transplant2 vs Control.5_Post-FMT1 1 0.833650830 3.13584966 0.163873030 0.001 0.153
Control.4_Transplant2 vs Treatment.5_Post-FMT1 1 1.080414607 4.22492316 0.219762811 0.001 0.153
Control.4_Transplant2 vs Hot_control.5_Post-FMT1 1 1.341135755 5.65148950 0.261020818 0.001 0.153
Control.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.926258626 4.22028175 0.208715279 0.001 0.153
Control.4_Transplant2 vs Control.6_Post-FMT2 1 0.574654578 2.45496178 0.133024484 0.001 0.153
Control.4_Transplant2 vs Hot_control.6_Post-FMT2 1 1.352206080 5.83128366 0.267106770 0.001 0.153
Treatment.4_Transplant2 vs Hot_control.4_Transplant2 1 0.012433593 0.07386441 0.006670157 1.000 1.000
Treatment.4_Transplant2 vs Control.5_Post-FMT1 1 1.291262283 4.81032755 0.270086417 0.001 0.153
Treatment.4_Transplant2 vs Treatment.5_Post-FMT1 1 0.771548746 3.01386503 0.200738786 0.002 0.306
Treatment.4_Transplant2 vs Hot_control.5_Post-FMT1 1 0.598950488 2.56717762 0.164909637 0.001 0.153
Treatment.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.584788938 2.76668773 0.175476788 0.001 0.153
Treatment.4_Transplant2 vs Control.6_Post-FMT2 1 1.258012524 5.48540220 0.296742378 0.001 0.153
Treatment.4_Transplant2 vs Hot_control.6_Post-FMT2 1 0.432278420 1.90731713 0.127945029 0.005 0.765
Hot_control.4_Transplant2 vs Control.5_Post-FMT1 1 1.399019323 5.36419518 0.277016170 0.001 0.153
Hot_control.4_Transplant2 vs Treatment.5_Post-FMT1 1 0.829245656 3.33377055 0.204102938 0.001 0.153
Hot_control.4_Transplant2 vs Hot_control.5_Post-FMT1 1 0.652357925 2.85882027 0.169574159 0.002 0.306
Hot_control.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.631349786 3.03802796 0.178308661 0.001 0.153
Hot_control.4_Transplant2 vs Control.6_Post-FMT2 1 1.377318091 6.13498096 0.304692662 0.001 0.153
Hot_control.4_Transplant2 vs Hot_control.6_Post-FMT2 1 0.447315329 2.01494401 0.125816488 0.003 0.459
Control.5_Post-FMT1 vs Treatment.5_Post-FMT1 1 0.561541773 1.72900374 0.103353658 0.013 1.000
Control.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.843842909 2.79377183 0.148654132 0.001 0.153
Control.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.762813539 2.68392536 0.143648902 0.001 0.153
Control.5_Post-FMT1 vs Control.6_Post-FMT2 1 0.343260479 1.14873316 0.066986474 0.257 1.000
Control.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 1.126958011 3.79925624 0.191888836 0.001 0.153
Treatment.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.373492058 1.26892925 0.077997097 0.114 1.000
Treatment.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.357139663 1.29718436 0.079595612 0.146 1.000
Treatment.5_Post-FMT1 vs Control.6_Post-FMT2 1 0.776946658 2.67089786 0.151146698 0.001 0.153
Treatment.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 0.650235954 2.25340711 0.130606500 0.003 0.459
Hot_control.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.413209131 1.61613759 0.091741881 0.008 1.000
Hot_control.5_Post-FMT1 vs Control.6_Post-FMT2 1 1.016399223 3.76057141 0.190306815 0.001 0.153
Hot_control.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 0.273256319 1.01928120 0.059889791 0.423 1.000
Treatment.6_Post-FMT2 vs Control.6_Post-FMT2 1 0.646381353 2.56044149 0.137951540 0.001 0.153
Treatment.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.479625583 1.91651999 0.106969433 0.001 0.153
Control.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 1.130504372 4.26831718 0.210590605 0.001 0.153
4.3.2.12.2 Neutral
betadisper(beta_div_neutral_all_comparison$S, all_comparison_arrange$type) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
           Df  Sum Sq  Mean Sq      F N.Perm Pr(>F)  
Groups      2 0.11629 0.058145 4.2503    999  0.022 *
Residuals 146 1.99732 0.013680                       
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              Control Hot_control Treatment
Control                 0.1110000     0.217
Hot_control 0.0992801                 0.005
Treatment   0.1988089   0.0039096          
#adonis2(formula=beta_div_neutral_all_comparison$S ~ time_point*type, data=all_comparison_arrange[labels(beta_div_neutral_all_comparison$S),], permutations=999,strata=all_comparison_arrange$individual) %>%
  #as.matrix() %>%
  #kable()
pairwise <- pairwise.adonis(beta_div_neutral_all_comparison$S, all_comparison_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.231601965 0.77129054 0.045988741 0.739 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 1.401534736 5.75623784 0.264578733 0.001 0.153
Control.1_Acclimation vs Control.2_Antibiotics 1 1.052408777 3.24991568 0.178078394 0.001 0.153
Control.1_Acclimation vs Treatment.2_Antibiotics 1 1.111553177 3.41189169 0.195951810 0.002 0.306
Control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.765907003 6.07675876 0.288315619 0.001 0.153
Control.1_Acclimation vs Control.3_Transplant1 1 0.537039622 2.17218034 0.119533281 0.003 0.459
Control.1_Acclimation vs Treatment.3_Transplant1 1 1.405564870 5.47754050 0.281223417 0.001 0.153
Control.1_Acclimation vs Hot_control.3_Transplant1 1 1.533003108 6.15337104 0.290893164 0.001 0.153
Control.1_Acclimation vs Control.4_Transplant2 1 0.352392363 1.45768829 0.083498357 0.085 1.000
Control.1_Acclimation vs Treatment.4_Transplant2 1 1.310880994 5.15468039 0.283931211 0.001 0.153
Control.1_Acclimation vs Hot_control.4_Transplant2 1 1.444103332 5.83290868 0.294102533 0.001 0.153
Control.1_Acclimation vs Control.5_Post-FMT1 1 0.833216183 2.90811026 0.153802269 0.001 0.153
Control.1_Acclimation vs Treatment.5_Post-FMT1 1 1.171959521 4.06855143 0.213364473 0.002 0.306
Control.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.426087479 5.24131714 0.246751042 0.001 0.153
Control.1_Acclimation vs Treatment.6_Post-FMT2 1 1.174642637 4.55647410 0.221656402 0.001 0.153
Control.1_Acclimation vs Control.6_Post-FMT2 1 0.528644071 1.98194080 0.110218403 0.004 0.612
Control.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.344322430 4.91044173 0.234832042 0.001 0.153
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 1.634770392 6.83268874 0.299250291 0.001 0.153
Treatment.1_Acclimation vs Control.2_Antibiotics 1 1.025810137 3.21247184 0.176388569 0.001 0.153
Treatment.1_Acclimation vs Treatment.2_Antibiotics 1 0.881227194 2.74559155 0.163959066 0.003 0.459
Treatment.1_Acclimation vs Hot_control.2_Antibiotics 1 1.875954242 6.55710727 0.304173802 0.001 0.153
Treatment.1_Acclimation vs Control.3_Transplant1 1 0.566432465 2.33088738 0.127156276 0.003 0.459
Treatment.1_Acclimation vs Treatment.3_Transplant1 1 1.572048670 6.24379035 0.308429906 0.001 0.153
Treatment.1_Acclimation vs Hot_control.3_Transplant1 1 1.701844881 6.95690050 0.316843468 0.001 0.153
Treatment.1_Acclimation vs Control.4_Transplant2 1 0.401361323 1.68977427 0.095522659 0.039 1.000
Treatment.1_Acclimation vs Treatment.4_Transplant2 1 1.459328039 5.85815805 0.310643173 0.001 0.153
Treatment.1_Acclimation vs Hot_control.4_Transplant2 1 1.598342225 6.58427533 0.319869183 0.001 0.153
Treatment.1_Acclimation vs Control.5_Post-FMT1 1 0.951763439 3.37156998 0.174047327 0.001 0.153
Treatment.1_Acclimation vs Treatment.5_Post-FMT1 1 1.312777350 4.62982556 0.235856684 0.001 0.153
Treatment.1_Acclimation vs Hot_control.5_Post-FMT1 1 1.671336875 6.23954604 0.280560854 0.001 0.153
Treatment.1_Acclimation vs Treatment.6_Post-FMT2 1 1.354029183 5.33980806 0.250227558 0.001 0.153
Treatment.1_Acclimation vs Control.6_Post-FMT2 1 0.631108857 2.40416255 0.130631456 0.003 0.459
Treatment.1_Acclimation vs Hot_control.6_Post-FMT2 1 1.612575528 5.98259806 0.272151547 0.001 0.153
Hot_control.1_Acclimation vs Control.2_Antibiotics 1 1.801830169 6.96394029 0.317062430 0.001 0.153
Hot_control.1_Acclimation vs Treatment.2_Antibiotics 1 1.796058823 7.01450160 0.333793384 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.2_Antibiotics 1 1.140094120 5.05560699 0.252079481 0.001 0.153
Hot_control.1_Acclimation vs Control.3_Transplant1 1 1.409800825 7.57086193 0.321195803 0.001 0.153
Hot_control.1_Acclimation vs Treatment.3_Transplant1 1 0.268029239 1.43433504 0.092931444 0.123 1.000
Hot_control.1_Acclimation vs Hot_control.3_Transplant1 1 0.271118909 1.47312872 0.089426165 0.108 1.000
Hot_control.1_Acclimation vs Control.4_Transplant2 1 1.448236257 8.01342873 0.333706145 0.001 0.153
Hot_control.1_Acclimation vs Treatment.4_Transplant2 1 0.259223626 1.44651346 0.100128897 0.165 1.000
Hot_control.1_Acclimation vs Hot_control.4_Transplant2 1 0.220654933 1.24074949 0.081410005 0.258 1.000
Hot_control.1_Acclimation vs Control.5_Post-FMT1 1 1.540978110 6.83380557 0.299284565 0.001 0.153
Hot_control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.913361414 4.09645344 0.214513834 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.695483464 3.29512337 0.170774932 0.001 0.153
Hot_control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.620232728 3.15198682 0.164577537 0.002 0.306
Hot_control.1_Acclimation vs Control.6_Post-FMT2 1 1.570117896 7.63270374 0.322972091 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.363443763 1.70833881 0.096470867 0.031 1.000
Control.2_Antibiotics vs Treatment.2_Antibiotics 1 0.309091831 0.88382033 0.063658295 0.589 1.000
Control.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.318315639 4.24836003 0.232807771 0.001 0.153
Control.2_Antibiotics vs Control.3_Transplant1 1 1.689711387 6.43107429 0.300081751 0.001 0.153
Control.2_Antibiotics vs Treatment.3_Transplant1 1 1.689195930 6.13766780 0.320711377 0.001 0.153
Control.2_Antibiotics vs Hot_control.3_Transplant1 1 1.809255022 6.80473556 0.327076282 0.001 0.153
Control.2_Antibiotics vs Control.4_Transplant2 1 1.677507510 6.53011334 0.303301392 0.001 0.153
Control.2_Antibiotics vs Treatment.4_Transplant2 1 1.627593397 5.93402835 0.330880951 0.003 0.459
Control.2_Antibiotics vs Hot_control.4_Transplant2 1 1.753895650 6.60608411 0.336940517 0.001 0.153
Control.2_Antibiotics vs Control.5_Post-FMT1 1 1.193795915 3.91871436 0.207134284 0.001 0.153
Control.2_Antibiotics vs Treatment.5_Post-FMT1 1 1.408395455 4.57891410 0.246457574 0.001 0.153
Control.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.733940673 5.99463357 0.285531707 0.001 0.153
Control.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.520214567 5.54808874 0.270005099 0.001 0.153
Control.2_Antibiotics vs Control.6_Post-FMT2 1 1.242673544 4.38276233 0.226116498 0.001 0.153
Control.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.690913277 5.80983211 0.279186880 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.2_Antibiotics 1 1.496671964 4.80650925 0.269929899 0.001 0.153
Treatment.2_Antibiotics vs Control.3_Transplant1 1 1.585917342 6.09171700 0.303195441 0.001 0.153
Treatment.2_Antibiotics vs Treatment.3_Transplant1 1 1.638410357 5.99150564 0.333018579 0.002 0.306
Treatment.2_Antibiotics vs Hot_control.3_Transplant1 1 1.752495870 6.64990939 0.338419341 0.001 0.153
Treatment.2_Antibiotics vs Control.4_Transplant2 1 1.594532431 6.27600416 0.309528648 0.001 0.153
Treatment.2_Antibiotics vs Treatment.4_Transplant2 1 1.569536480 5.76455490 0.343853740 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.4_Transplant2 1 1.692716606 6.43803058 0.349171271 0.001 0.153
Treatment.2_Antibiotics vs Control.5_Post-FMT1 1 1.203693742 3.94355452 0.219775548 0.001 0.153
Treatment.2_Antibiotics vs Treatment.5_Post-FMT1 1 1.342345723 4.35196799 0.250805441 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.646821658 5.70346727 0.289465158 0.001 0.153
Treatment.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.526094538 5.60220112 0.285794492 0.001 0.153
Treatment.2_Antibiotics vs Control.6_Post-FMT2 1 1.228569941 4.34707035 0.236935394 0.002 0.306
Treatment.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.612642625 5.54814849 0.283819641 0.001 0.153
Hot_control.2_Antibiotics vs Control.3_Transplant1 1 2.115607623 9.21771686 0.380618739 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.3_Transplant1 1 1.101992427 4.65211649 0.263544403 0.002 0.306
Hot_control.2_Antibiotics vs Hot_control.3_Transplant1 1 1.133256122 4.92116448 0.260087823 0.001 0.153
Hot_control.2_Antibiotics vs Control.4_Transplant2 1 2.176300247 9.73032474 0.393457217 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.4_Transplant2 1 1.172716857 5.03855938 0.295715105 0.002 0.306
Hot_control.2_Antibiotics vs Hot_control.4_Transplant2 1 1.204981537 5.30457458 0.289795021 0.002 0.306
Hot_control.2_Antibiotics vs Control.5_Post-FMT1 1 1.680870091 6.19302659 0.292220017 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.5_Post-FMT1 1 1.405394667 5.16721122 0.269585969 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.362143588 5.32040618 0.261825779 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.579851347 6.56137424 0.304311505 0.001 0.153
Hot_control.2_Antibiotics vs Control.6_Post-FMT2 1 1.877053661 7.49890802 0.333300977 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.274827637 4.94469852 0.247920444 0.001 0.153
Control.3_Transplant1 vs Treatment.3_Transplant1 1 1.210492327 6.33244693 0.311445393 0.001 0.153
Control.3_Transplant1 vs Hot_control.3_Transplant1 1 1.329816668 7.07170798 0.320396953 0.001 0.153
Control.3_Transplant1 vs Control.4_Transplant2 1 0.095527891 0.51782131 0.031349250 0.899 1.000
Control.3_Transplant1 vs Treatment.4_Transplant2 1 1.202957055 6.54398303 0.334833643 0.002 0.306
Control.3_Transplant1 vs Hot_control.4_Transplant2 1 1.336430279 7.33775774 0.343886074 0.001 0.153
Control.3_Transplant1 vs Control.5_Post-FMT1 1 0.869030126 3.79079171 0.191543207 0.001 0.153
Control.3_Transplant1 vs Treatment.5_Post-FMT1 1 1.126784833 4.96449923 0.248666354 0.001 0.153
Control.3_Transplant1 vs Hot_control.5_Post-FMT1 1 1.449934099 6.74957054 0.296690020 0.001 0.153
Control.3_Transplant1 vs Treatment.6_Post-FMT2 1 1.104217737 5.50651250 0.256039304 0.001 0.153
Control.3_Transplant1 vs Control.6_Post-FMT2 1 0.789637714 3.76981024 0.190685201 0.001 0.153
Control.3_Transplant1 vs Hot_control.6_Post-FMT2 1 1.536951488 7.09904578 0.307330694 0.001 0.153
Treatment.3_Transplant1 vs Hot_control.3_Transplant1 1 0.009634139 0.05096559 0.003905121 1.000 1.000
Treatment.3_Transplant1 vs Control.4_Transplant2 1 1.400930696 7.57729789 0.351169916 0.001 0.153
Treatment.3_Transplant1 vs Treatment.4_Transplant2 1 0.070676505 0.38364693 0.033701584 0.936 1.000
Treatment.3_Transplant1 vs Hot_control.4_Transplant2 1 0.078300724 0.42972488 0.034572356 0.880 1.000
Treatment.3_Transplant1 vs Control.5_Post-FMT1 1 1.367122874 5.79171991 0.292633482 0.002 0.306
Treatment.3_Transplant1 vs Treatment.5_Post-FMT1 1 0.751062093 3.21047535 0.198049426 0.003 0.459
Treatment.3_Transplant1 vs Hot_control.5_Post-FMT1 1 0.541926060 2.46826366 0.149880019 0.004 0.612
Treatment.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.592624022 2.91606971 0.172384588 0.001 0.153
Treatment.3_Transplant1 vs Control.6_Post-FMT2 1 1.523500334 7.13792666 0.337683387 0.001 0.153
Treatment.3_Transplant1 vs Hot_control.6_Post-FMT2 1 0.502178159 2.26737096 0.139381524 0.011 1.000
Hot_control.3_Transplant1 vs Control.4_Transplant2 1 1.529217161 8.39335845 0.358792367 0.001 0.153
Hot_control.3_Transplant1 vs Treatment.4_Transplant2 1 0.067325622 0.37214249 0.030079066 0.927 1.000
Hot_control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.060700684 0.33852115 0.025379211 0.954 1.000
Hot_control.3_Transplant1 vs Control.5_Post-FMT1 1 1.488235610 6.47212491 0.301419861 0.001 0.153
Hot_control.3_Transplant1 vs Treatment.5_Post-FMT1 1 0.831659790 3.65479114 0.207014125 0.001 0.153
Hot_control.3_Transplant1 vs Hot_control.5_Post-FMT1 1 0.615759083 2.86994158 0.160601621 0.002 0.306
Hot_control.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.650193072 3.26217668 0.178630222 0.001 0.153
Hot_control.3_Transplant1 vs Control.6_Post-FMT2 1 1.644765070 7.87562973 0.344280347 0.001 0.153
Hot_control.3_Transplant1 vs Hot_control.6_Post-FMT2 1 0.529144591 2.44579001 0.140193709 0.004 0.612
Control.4_Transplant2 vs Treatment.4_Transplant2 1 1.318966989 7.44875581 0.364264500 0.001 0.153
Control.4_Transplant2 vs Hot_control.4_Transplant2 1 1.461842335 8.31259383 0.372551658 0.001 0.153
Control.4_Transplant2 vs Control.5_Post-FMT1 1 0.837927278 3.74476269 0.189658531 0.001 0.153
Control.4_Transplant2 vs Treatment.5_Post-FMT1 1 1.237187346 5.59522781 0.271675937 0.001 0.153
Control.4_Transplant2 vs Hot_control.5_Post-FMT1 1 1.592357282 7.60689288 0.322231855 0.001 0.153
Control.4_Transplant2 vs Treatment.6_Post-FMT2 1 1.205873137 6.18264781 0.278715502 0.001 0.153
Control.4_Transplant2 vs Control.6_Post-FMT2 1 0.632526126 3.10098856 0.162347020 0.001 0.153
Control.4_Transplant2 vs Hot_control.6_Post-FMT2 1 1.582795172 7.50092755 0.319175808 0.001 0.153
Treatment.4_Transplant2 vs Hot_control.4_Transplant2 1 0.012314222 0.07128989 0.006439167 1.000 1.000
Treatment.4_Transplant2 vs Control.5_Post-FMT1 1 1.342607528 5.78285738 0.307879534 0.001 0.153
Treatment.4_Transplant2 vs Treatment.5_Post-FMT1 1 0.747258352 3.25510805 0.213378236 0.003 0.459
Treatment.4_Transplant2 vs Hot_control.5_Post-FMT1 1 0.553729649 2.58255490 0.165733727 0.002 0.306
Treatment.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.566094860 2.87613678 0.181160998 0.001 0.153
Treatment.4_Transplant2 vs Control.6_Post-FMT2 1 1.445460896 6.95533179 0.348545034 0.001 0.153
Treatment.4_Transplant2 vs Hot_control.6_Post-FMT2 1 0.460097406 2.12533559 0.140514938 0.008 1.000
Hot_control.4_Transplant2 vs Control.5_Post-FMT1 1 1.463793289 6.44782331 0.315330547 0.001 0.153
Hot_control.4_Transplant2 vs Treatment.5_Post-FMT1 1 0.828827179 3.69648712 0.221393105 0.003 0.459
Hot_control.4_Transplant2 vs Hot_control.5_Post-FMT1 1 0.627968770 2.98278398 0.175635749 0.002 0.306
Hot_control.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.613502889 3.15912171 0.184107425 0.001 0.153
Hot_control.4_Transplant2 vs Control.6_Post-FMT2 1 1.570619682 7.68364100 0.354351974 0.001 0.153
Hot_control.4_Transplant2 vs Hot_control.6_Post-FMT2 1 0.469820686 2.21140107 0.136410238 0.008 1.000
Control.5_Post-FMT1 vs Treatment.5_Post-FMT1 1 0.605177838 2.25084909 0.130477583 0.017 1.000
Control.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 1.052890187 4.14363688 0.205704506 0.001 0.153
Control.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.890815765 3.71469204 0.188422524 0.003 0.459
Control.5_Post-FMT1 vs Control.6_Post-FMT2 1 0.386092689 1.55217583 0.088432104 0.079 1.000
Control.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 1.312223689 5.13027257 0.242792541 0.001 0.153
Treatment.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.415007562 1.63726831 0.098409684 0.047 1.000
Treatment.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.315707871 1.32520255 0.081175259 0.160 1.000
Treatment.5_Post-FMT1 vs Control.6_Post-FMT2 1 1.057952050 4.27000973 0.221588354 0.001 0.153
Treatment.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 0.745401493 2.92004928 0.162948730 0.001 0.153
Hot_control.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.437716066 1.94212609 0.108243922 0.007 1.000
Hot_control.5_Post-FMT1 vs Control.6_Post-FMT2 1 1.376659749 5.87527887 0.268580753 0.001 0.153
Hot_control.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 0.317651641 1.31613667 0.076006369 0.194 1.000
Treatment.6_Post-FMT2 vs Control.6_Post-FMT2 1 1.022748131 4.64833456 0.225119103 0.001 0.153
Treatment.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.501020156 2.20653207 0.121194529 0.001 0.153
Control.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 1.361942386 5.77103132 0.265078454 0.001 0.153
4.3.2.12.3 Phylogenetic
betadisper(beta_div_phylo_all_comparison$S, all_comparison_arrange$time_point) %>% permutest(., pairwise = TRUE)

Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999

Response: Distances
           Df Sum Sq  Mean Sq      F N.Perm Pr(>F)    
Groups      5 1.4944 0.298874 25.319    999  0.001 ***
Residuals 143 1.6880 0.011804                         
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise comparisons:
(Observed p-value below diagonal, permuted p-value above diagonal)
              1_Acclimation 2_Antibiotics 3_Transplant1 4_Transplant2 5_Post-FMT1 6_Post-FMT2
1_Acclimation                  1.0000e-03    1.8100e-01    3.3000e-02  1.2100e-01       0.024
2_Antibiotics    3.2520e-07                  1.0000e-03    1.0000e-03  1.0000e-03       0.001
3_Transplant1    1.7307e-01    7.3009e-11                  5.0700e-01  8.3000e-01       0.573
4_Transplant2    3.3595e-02    6.1072e-17    4.8835e-01                6.3400e-01       0.862
5_Post-FMT1      1.1014e-01    7.7616e-12    8.3839e-01    6.4333e-01                   0.697
6_Post-FMT2      3.0349e-02    1.9424e-17    5.4602e-01    8.4889e-01  7.1872e-01            
#adonis2(formula=beta_div_phylo_all_comparison$S ~ time_point*type, data=all_comparison_arrange[labels(beta_div_phylo_all_comparison$S),], permutations=999,strata=all_comparison_arrange$individual) %>%
  #as.matrix() %>%
  #kable()
pairwise <- pairwise.adonis(beta_div_phylo_all_comparison$S, all_comparison_arrange$type_time, perm=999)
pairwise%>%
  tt()
pairs Df SumsOfSqs F.Model R2 p.value p.adjusted sig
Control.1_Acclimation vs Treatment.1_Acclimation 1 0.041869229 0.43916424 0.026714511 0.722 1.000
Control.1_Acclimation vs Hot_control.1_Acclimation 1 0.156094158 2.55468892 0.137684276 0.028 1.000
Control.1_Acclimation vs Control.2_Antibiotics 1 0.861337080 5.65998778 0.273958912 0.001 0.153
Control.1_Acclimation vs Treatment.2_Antibiotics 1 0.913173267 6.56821615 0.319338153 0.001 0.153
Control.1_Acclimation vs Hot_control.2_Antibiotics 1 0.700066804 5.49233852 0.268019119 0.001 0.153
Control.1_Acclimation vs Control.3_Transplant1 1 0.033988546 0.51289646 0.031060357 0.743 1.000
Control.1_Acclimation vs Treatment.3_Transplant1 1 0.215372330 2.72760052 0.163059879 0.019 1.000
Control.1_Acclimation vs Hot_control.3_Transplant1 1 0.231242466 3.05823713 0.169354135 0.009 1.000
Control.1_Acclimation vs Control.4_Transplant2 1 0.028305397 0.51176469 0.030993943 0.735 1.000
Control.1_Acclimation vs Treatment.4_Transplant2 1 0.208435351 2.91338090 0.183077431 0.023 1.000
Control.1_Acclimation vs Hot_control.4_Transplant2 1 0.238647956 3.50464793 0.200212420 0.010 1.000
Control.1_Acclimation vs Control.5_Post-FMT1 1 0.191933673 2.97499219 0.156784896 0.022 1.000
Control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.146272881 1.79073807 0.106650349 0.144 1.000
Control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.250613478 3.61461852 0.184281867 0.010 1.000
Control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.263223310 4.30602808 0.212056640 0.005 0.765
Control.1_Acclimation vs Control.6_Post-FMT2 1 0.160478949 2.54057422 0.137027807 0.040 1.000
Control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.255295098 4.01091382 0.200436315 0.003 0.459
Treatment.1_Acclimation vs Hot_control.1_Acclimation 1 0.231088456 4.05218385 0.202081922 0.003 0.459
Treatment.1_Acclimation vs Control.2_Antibiotics 1 0.696872587 4.71383535 0.239113053 0.001 0.153
Treatment.1_Acclimation vs Treatment.2_Antibiotics 1 0.689137599 5.12849058 0.268107437 0.004 0.612
Treatment.1_Acclimation vs Hot_control.2_Antibiotics 1 0.596592947 4.84570105 0.244168802 0.002 0.306
Treatment.1_Acclimation vs Control.3_Transplant1 1 0.105837772 1.70171045 0.096132543 0.150 1.000
Treatment.1_Acclimation vs Treatment.3_Transplant1 1 0.271525858 3.65417744 0.206986559 0.008 1.000
Treatment.1_Acclimation vs Hot_control.3_Transplant1 1 0.286283719 4.01697126 0.211230864 0.003 0.459
Treatment.1_Acclimation vs Control.4_Transplant2 1 0.075042716 1.46463442 0.083862873 0.233 1.000
Treatment.1_Acclimation vs Treatment.4_Transplant2 1 0.276043921 4.14908181 0.241941922 0.014 1.000
Treatment.1_Acclimation vs Hot_control.4_Transplant2 1 0.308698871 4.86600187 0.257924382 0.004 0.612
Treatment.1_Acclimation vs Control.5_Post-FMT1 1 0.263584652 4.36089602 0.214179966 0.005 0.765
Treatment.1_Acclimation vs Treatment.5_Post-FMT1 1 0.253194274 3.27384223 0.179154563 0.046 1.000
Treatment.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.390501202 5.98373926 0.272189330 0.001 0.153
Treatment.1_Acclimation vs Treatment.6_Post-FMT2 1 0.364968924 6.39666658 0.285607975 0.001 0.153
Treatment.1_Acclimation vs Control.6_Post-FMT2 1 0.226282101 3.82922197 0.193110046 0.014 1.000
Treatment.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.348308136 5.84633352 0.267611657 0.001 0.153
Hot_control.1_Acclimation vs Control.2_Antibiotics 1 1.097240771 9.85701700 0.396548669 0.001 0.153
Hot_control.1_Acclimation vs Treatment.2_Antibiotics 1 1.223589280 12.84663319 0.478519340 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.2_Antibiotics 1 0.661505415 7.63879773 0.337420645 0.001 0.153
Hot_control.1_Acclimation vs Control.3_Transplant1 1 0.081539620 2.91655101 0.154179851 0.003 0.459
Hot_control.1_Acclimation vs Treatment.3_Transplant1 1 0.030226267 0.85925828 0.057826458 0.547 1.000
Hot_control.1_Acclimation vs Hot_control.3_Transplant1 1 0.033410268 0.96148331 0.060237716 0.462 1.000
Hot_control.1_Acclimation vs Control.4_Transplant2 1 0.096380142 5.66972138 0.261642560 0.001 0.153
Hot_control.1_Acclimation vs Treatment.4_Transplant2 1 0.035245258 1.44489196 0.100027883 0.222 1.000
Hot_control.1_Acclimation vs Hot_control.4_Transplant2 1 0.032336674 1.33009788 0.086763822 0.273 1.000
Hot_control.1_Acclimation vs Control.5_Post-FMT1 1 0.142033756 5.42002118 0.253035286 0.001 0.153
Hot_control.1_Acclimation vs Treatment.5_Post-FMT1 1 0.096667531 2.36821735 0.136353507 0.015 1.000
Hot_control.1_Acclimation vs Hot_control.5_Post-FMT1 1 0.092525999 2.98249577 0.157118211 0.007 1.000
Hot_control.1_Acclimation vs Treatment.6_Post-FMT2 1 0.100028707 4.38362373 0.215056154 0.001 0.153
Hot_control.1_Acclimation vs Control.6_Post-FMT2 1 0.125775098 5.06012870 0.240270550 0.001 0.153
Hot_control.1_Acclimation vs Hot_control.6_Post-FMT2 1 0.063343780 2.49977367 0.135124554 0.011 1.000
Control.2_Antibiotics vs Treatment.2_Antibiotics 1 0.094083678 0.46354958 0.034429968 0.874 1.000
Control.2_Antibiotics vs Hot_control.2_Antibiotics 1 0.631160740 3.39326529 0.195090757 0.001 0.153
Control.2_Antibiotics vs Control.3_Transplant1 1 1.081539517 9.25761888 0.381637576 0.001 0.153
Control.2_Antibiotics vs Treatment.3_Transplant1 1 1.004005224 7.26097560 0.358372457 0.001 0.153
Control.2_Antibiotics vs Hot_control.3_Transplant1 1 1.080757579 8.28477913 0.371768510 0.001 0.153
Control.2_Antibiotics vs Control.4_Transplant2 1 1.152040544 10.95741891 0.422130526 0.001 0.153
Control.2_Antibiotics vs Treatment.4_Transplant2 1 1.027702743 7.60232276 0.387827650 0.002 0.306
Control.2_Antibiotics vs Hot_control.4_Transplant2 1 1.079920015 8.53201595 0.396247893 0.002 0.306
Control.2_Antibiotics vs Control.5_Post-FMT1 1 1.083638513 9.42638693 0.385909998 0.001 0.153
Control.2_Antibiotics vs Treatment.5_Post-FMT1 1 1.014079699 7.40449675 0.345931831 0.002 0.306
Control.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.241652163 10.33876224 0.408021597 0.002 0.306
Control.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.183002877 10.62460826 0.414625197 0.001 0.153
Control.2_Antibiotics vs Control.6_Post-FMT2 1 1.135907392 10.00634083 0.400152141 0.001 0.153
Control.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.225141484 10.74358446 0.417330558 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.2_Antibiotics 1 0.751305380 4.30687517 0.248853426 0.002 0.306
Treatment.2_Antibiotics vs Control.3_Transplant1 1 1.147414607 11.34359994 0.447592290 0.002 0.306
Treatment.2_Antibiotics vs Treatment.3_Transplant1 1 1.144190161 9.39612190 0.439150700 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.3_Transplant1 1 1.209231054 10.55018954 0.447987458 0.001 0.153
Treatment.2_Antibiotics vs Control.4_Transplant2 1 1.175774920 13.26657109 0.486550767 0.001 0.153
Treatment.2_Antibiotics vs Treatment.4_Transplant2 1 1.099595076 9.40628827 0.460950475 0.005 0.765
Treatment.2_Antibiotics vs Hot_control.4_Transplant2 1 1.178403909 10.80153268 0.473719588 0.001 0.153
Treatment.2_Antibiotics vs Control.5_Post-FMT1 1 1.144139048 11.53966642 0.451833091 0.002 0.306
Treatment.2_Antibiotics vs Treatment.5_Post-FMT1 1 1.099646668 9.04159547 0.410206034 0.002 0.306
Treatment.2_Antibiotics vs Hot_control.5_Post-FMT1 1 1.342895837 12.83174099 0.478229907 0.001 0.153
Treatment.2_Antibiotics vs Treatment.6_Post-FMT2 1 1.284614156 13.48281445 0.490590746 0.001 0.153
Treatment.2_Antibiotics vs Control.6_Post-FMT2 1 1.215005290 12.44801755 0.470659758 0.001 0.153
Treatment.2_Antibiotics vs Hot_control.6_Post-FMT2 1 1.268089884 12.91871587 0.479915756 0.002 0.306
Hot_control.2_Antibiotics vs Control.3_Transplant1 1 0.849076966 9.21813905 0.380629537 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.3_Transplant1 1 0.596636472 5.43613272 0.294862963 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.3_Transplant1 1 0.615692862 5.92195472 0.297257714 0.001 0.153
Hot_control.2_Antibiotics vs Control.4_Transplant2 1 0.876797436 10.90268092 0.420909363 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.4_Transplant2 1 0.674952556 6.47214657 0.350373279 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.4_Transplant2 1 0.686432726 7.00067496 0.350021935 0.002 0.306
Hot_control.2_Antibiotics vs Control.5_Post-FMT1 1 0.849330865 9.41186993 0.385544817 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.5_Post-FMT1 1 0.752694639 6.81347752 0.327358920 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.5_Post-FMT1 1 0.843320169 8.84176238 0.370851879 0.001 0.153
Hot_control.2_Antibiotics vs Treatment.6_Post-FMT2 1 0.983612960 11.35445189 0.430836199 0.001 0.153
Hot_control.2_Antibiotics vs Control.6_Post-FMT2 1 0.885529745 9.97205129 0.399328480 0.001 0.153
Hot_control.2_Antibiotics vs Hot_control.6_Post-FMT2 1 0.840123658 9.40607766 0.385398989 0.001 0.153
Control.3_Transplant1 vs Treatment.3_Transplant1 1 0.098602035 2.40012240 0.146347835 0.055 1.000
Control.3_Transplant1 vs Hot_control.3_Transplant1 1 0.111980145 2.78142890 0.156423250 0.014 1.000
Control.3_Transplant1 vs Control.4_Transplant2 1 0.007928377 0.35768341 0.021866385 0.915 1.000
Control.3_Transplant1 vs Treatment.4_Transplant2 1 0.107460204 3.49439587 0.211853523 0.010 1.000
Control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.123295950 4.08042827 0.225682058 0.003 0.459
Control.3_Transplant1 vs Control.5_Post-FMT1 1 0.096104530 3.06336633 0.160693881 0.001 0.153
Control.3_Transplant1 vs Treatment.5_Post-FMT1 1 0.082810318 1.78740344 0.106472895 0.141 1.000
Control.3_Transplant1 vs Hot_control.5_Post-FMT1 1 0.118218149 3.26661338 0.169547876 0.008 1.000
Control.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.136974123 4.89446159 0.234246840 0.001 0.153
Control.3_Transplant1 vs Control.6_Post-FMT2 1 0.097169276 3.23650370 0.168248022 0.004 0.612
Control.3_Transplant1 vs Hot_control.6_Post-FMT2 1 0.152527104 4.99980434 0.238088139 0.001 0.153
Treatment.3_Transplant1 vs Hot_control.3_Transplant1 1 0.001916654 0.03838869 0.002944282 0.987 1.000
Treatment.3_Transplant1 vs Control.4_Transplant2 1 0.138394849 4.84607372 0.257139699 0.001 0.153
Treatment.3_Transplant1 vs Treatment.4_Transplant2 1 0.022693131 0.56103262 0.048527899 0.659 1.000
Treatment.3_Transplant1 vs Hot_control.4_Transplant2 1 0.016177953 0.41465150 0.033400172 0.733 1.000
Treatment.3_Transplant1 vs Control.5_Post-FMT1 1 0.114864381 2.93924035 0.173516656 0.005 0.765
Treatment.3_Transplant1 vs Treatment.5_Post-FMT1 1 0.083463697 1.46603865 0.101343477 0.171 1.000
Treatment.3_Transplant1 vs Hot_control.5_Post-FMT1 1 0.064149535 1.43879911 0.093193719 0.310 1.000
Treatment.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.100463445 2.85333394 0.169303827 0.009 1.000
Treatment.3_Transplant1 vs Control.6_Post-FMT2 1 0.132425349 3.52780737 0.201269177 0.001 0.153
Treatment.3_Transplant1 vs Hot_control.6_Post-FMT2 1 0.069766618 1.83160737 0.115693077 0.101 1.000
Hot_control.3_Transplant1 vs Control.4_Transplant2 1 0.151529980 5.30364409 0.261216364 0.001 0.153
Hot_control.3_Transplant1 vs Treatment.4_Transplant2 1 0.018543667 0.46976985 0.037672696 0.715 1.000
Hot_control.3_Transplant1 vs Hot_control.4_Transplant2 1 0.011324236 0.29624361 0.022280248 0.828 1.000
Hot_control.3_Transplant1 vs Control.5_Post-FMT1 1 0.129157334 3.36426411 0.183196239 0.003 0.459
Hot_control.3_Transplant1 vs Treatment.5_Post-FMT1 1 0.096537959 1.75784138 0.111553438 0.084 1.000
Hot_control.3_Transplant1 vs Hot_control.5_Post-FMT1 1 0.077813129 1.78758462 0.106482538 0.202 1.000
Hot_control.3_Transplant1 vs Treatment.6_Post-FMT2 1 0.115011676 3.30697422 0.180640131 0.004 0.612
Hot_control.3_Transplant1 vs Control.6_Post-FMT2 1 0.146133526 3.95471424 0.208640140 0.001 0.153
Hot_control.3_Transplant1 vs Hot_control.6_Post-FMT2 1 0.066529056 1.77563878 0.105846270 0.108 1.000
Control.4_Transplant2 vs Treatment.4_Transplant2 1 0.123072115 7.12848761 0.354149191 0.001 0.153
Control.4_Transplant2 vs Hot_control.4_Transplant2 1 0.149801593 8.46696532 0.376862883 0.001 0.153
Control.4_Transplant2 vs Control.5_Post-FMT1 1 0.113967223 5.58286749 0.258671258 0.001 0.153
Control.4_Transplant2 vs Treatment.5_Post-FMT1 1 0.106396986 3.07142348 0.169960240 0.014 1.000
Control.4_Transplant2 vs Hot_control.5_Post-FMT1 1 0.165133142 6.54475611 0.290300595 0.001 0.153
Control.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.143231082 8.41195737 0.344583486 0.001 0.153
Control.4_Transplant2 vs Control.6_Post-FMT2 1 0.090154714 4.72894088 0.228132296 0.001 0.153
Control.4_Transplant2 vs Hot_control.6_Post-FMT2 1 0.168581391 8.62389999 0.350224781 0.002 0.306
Treatment.4_Transplant2 vs Hot_control.4_Transplant2 1 0.001788609 0.06719083 0.006071173 0.978 1.000
Treatment.4_Transplant2 vs Control.5_Post-FMT1 1 0.112305287 3.92735591 0.232012367 0.005 0.765
Treatment.4_Transplant2 vs Treatment.5_Post-FMT1 1 0.091039233 1.93447512 0.138826551 0.069 1.000
Treatment.4_Transplant2 vs Hot_control.5_Post-FMT1 1 0.066940234 1.93888992 0.129788085 0.116 1.000
Treatment.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.064927309 2.65796523 0.169751637 0.032 1.000
Treatment.4_Transplant2 vs Control.6_Post-FMT2 1 0.118518130 4.40015430 0.252880188 0.004 0.612
Treatment.4_Transplant2 vs Hot_control.6_Post-FMT2 1 0.022954896 0.83380428 0.060272956 0.559 1.000
Hot_control.4_Transplant2 vs Control.5_Post-FMT1 1 0.131900448 4.67500775 0.250334983 0.002 0.306
Hot_control.4_Transplant2 vs Treatment.5_Post-FMT1 1 0.104293524 2.30585040 0.150651570 0.021 1.000
Hot_control.4_Transplant2 vs Hot_control.5_Post-FMT1 1 0.072523344 2.15076384 0.133167933 0.086 1.000
Hot_control.4_Transplant2 vs Treatment.6_Post-FMT2 1 0.079939737 3.28382512 0.189994118 0.013 1.000
Hot_control.4_Transplant2 vs Control.6_Post-FMT2 1 0.139482909 5.22957940 0.271954955 0.001 0.153
Hot_control.4_Transplant2 vs Hot_control.6_Post-FMT2 1 0.027328390 1.00380807 0.066903553 0.427 1.000
Control.5_Post-FMT1 vs Treatment.5_Post-FMT1 1 0.018425353 0.41441625 0.026884978 0.767 1.000
Control.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.059879674 1.73878474 0.098021638 0.114 1.000
Control.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.079172437 3.01800458 0.158691968 0.006 0.918
Control.5_Post-FMT1 vs Control.6_Post-FMT2 1 0.043354907 1.53356039 0.087464289 0.147 1.000
Control.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 0.107830455 3.75004375 0.189875212 0.001 0.153
Treatment.5_Post-FMT1 vs Hot_control.5_Post-FMT1 1 0.032129657 0.64777824 0.041397458 0.690 1.000
Treatment.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.063935389 1.56518170 0.094486238 0.133 1.000
Treatment.5_Post-FMT1 vs Control.6_Post-FMT2 1 0.052659492 1.22402031 0.075444944 0.292 1.000
Treatment.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 0.097535009 2.24024291 0.129942654 0.014 1.000
Hot_control.5_Post-FMT1 vs Treatment.6_Post-FMT2 1 0.072285454 2.32795928 0.127016830 0.037 1.000
Hot_control.5_Post-FMT1 vs Control.6_Post-FMT2 1 0.117590942 3.55384441 0.181746583 0.001 0.153
Hot_control.5_Post-FMT1 vs Hot_control.6_Post-FMT2 1 0.066672554 1.98595267 0.110416874 0.099 1.000
Treatment.6_Post-FMT2 vs Control.6_Post-FMT2 1 0.059274536 2.38202535 0.129584488 0.021 1.000
Treatment.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.069062800 2.72246021 0.145411456 0.003 0.459
Control.6_Post-FMT2 vs Hot_control.6_Post-FMT2 1 0.110817088 4.04365610 0.201742441 0.001 0.153
beta_richness_nmds_all_comparison <- beta_div_richness_all_comparison$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(all_comparison_nmds, by = join_by(sample == newID))

beta_neutral_nmds_all_comparison <- beta_div_neutral_all_comparison$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(all_comparison_nmds, by = join_by(sample == newID))

beta_phylo_nmds_all_comparison <- beta_div_phylo_all_comparison$S %>%
  metaMDS(.,trymax = 500, k=2, verbosity=FALSE) %>%
  scores() %>%
  as_tibble(., rownames = "sample") %>%
  left_join(all_comparison_nmds, by = join_by(sample == newID))